But it seems as if there is no such test case in the judge's test cases.
ie , The area of the largest piece is never greater than half the area of the cake in any of judge's input. I thk these cases can also be included.
Please correct me if i am wrong.
But I look at the input file that I sent and there really are cases where size of larger piece > half of size of cake... And to solve such cases, one doesn't even need to treat them specially.
Of course, I don't know if the test data they use have been modified or not.
7th Contest of Newbies Date: December 31st, 2011 (Saturday) Time: 12:00 - 16:00 (UTC) URL: http://uva.onlinejudge.org
If you have absolutely no idea where to start, try drawing some cases on paper. I think you should at least know how to compute the areas on paper......
7th Contest of Newbies Date: December 31st, 2011 (Saturday) Time: 12:00 - 16:00 (UTC) URL: http://uva.onlinejudge.org
However I can't see a solution using basic geometry. I tried with integral calculus but got stock. Is there a solution using Euclidian or Analytic Geometry?
Runtime errors in Pascal are reported as Wrong Answers by the online judge. Be careful.
If you fail to get anything from your drawings then I don't know what hints I can give, since it seems that you don't even know what you are trying to compute... I think you should at least try to work out mitsiddharth's sample by hand (and calculator). Otherwise I am afraid that no hint will be useful to you.
7th Contest of Newbies Date: December 31st, 2011 (Saturday) Time: 12:00 - 16:00 (UTC) URL: http://uva.onlinejudge.org