Hi. I need to create a method, in the following signature:
int x (int y);
That's the example of values that this it should return:
x(3) = 1
x(4) = 1
x(5) = 2
x(6) = 2
x(7) = 3
x(8) = 3
x(9) = 4
x(10) = 4
...
Any ideas how could I do it?
Thank you.
EDIT: That's what I've got so far:
static int x(int y)
{
return (y / 2) - 1;
}
but the problem is that:
x(3) = 0
x(4) = 1
x(5) = 1
x(6) = 2