Problem #154
Vikas and Cows
Vikas has a rectangular farm of dimensions a*b in 'Amazon' forest. He also has 4 cows. The 4 cows are very aggressive. So he ties his cows to the 4 corners of the farm through ropes. The length of ropes are r1, r2, r3, r4. He wants to maximise the grazing area. But, as the cows are aggressive, he does not want the cows to fight.
F(a, b) = Maximum area of the farm that can be grazed by the cows
S(a, x) = \sum_{b=a}^x F(a, b)
Output \lfloor S(4, 1000) \rfloor