Please help ANy Idea????

Write your question here.

Little Josh has found several sticks that are each 1 inch long. He wants to form a rectangle with the biggest possible area, using these sticks as the perimeter. He is allowed to glue sticks together, but he is not allowed to break a single stick into multiple shorter sticks.

For example, if Josh has 11 sticks, he can create a 2 x 3 rectangle using 10 sticks. This rectangle has an area of 6 square inches, which is the biggest area that can be achieved in this case.

You will be given an int N as input from the user, and you must output the maximal area (in square inches) of a rectangle that can be created using N or less sticks.

Your program should loop as long as the user wishes to.

Constraints
- N will be between 4 and 10000, inclusive.

Examples
0)
11
Returns: 6
The example from the problem statement.

1)
5
Returns: 1
The only rectangle that can be created is a square with 1 inch side.

2)
64
Returns: 256
Josh can create a square with the 16 inches side.

3)
753
Returns: 35344

4)
7254
Returns: 3288782
Topic archived. No new replies allowed.