The value of the above table is defined as .
(Note: represents the greatest integer smaller than . E.g. )
Fluffy’s homework is to find the minimum number of 90° clockwise rotations to maximise the value of the table.
A 90° clockwise rotation looks like the following:
In the above example, the table’s initial value is while the table’s value after one rotation is .
Help Fluffy with his homework!
There are two lines of input.
The first line contains two integers and .
The second line contains two integers and .
Output an integer , the minimum number of 90° clockwise rotations needed to maximise the table’s value.
After 2 rotations, the table’s value is , which is the maximum possible.
(How do I solve that in C++?)