DSolved..
*EDIT CODE REMOVED!
fCan you please explain the task in English? I don't understand Serbian....
pYou are given a number N - number of squares (farms).
In the next N lines, there are 3 real numbers. First number is X coordinate of the lower left corner of the square, and second number is Y coordinate. 3rd number is the length of the square's side.
You have to find 2 lines parallel to Y-axis that divide the squares in 3 parts, so that the total area of all the squares (or parts of the squares) in all 3 parts is equal (all the farmers have to get equal area of the farm). Then you have to write the X coordinate of those 2 lines.
So if the total area of all the farms is, for example, 300, each farmer has to get 100.
In the sample test, first farmer gets 2/3 of the first farm, second farmer gets 1/3 of the first farm and 1/3 of the second farm, and third farmer gets 2/3 of the second farm.
fSorry, can the rectangles overlap?
DOh thanks what a silly mistake , it fails on Last one now :D
DSolved ,thanks everyone...
Many hints for this task:D
ABinary search for both X coordinates .
Mbut how can i know which farms should be divided
AHmm ,
Go binary search for some X1 that when you draw normal line to X-axis in X1 on your left side you have 1 / 3 of total Area, then Binary search for X2 that when you draw normal line to X-axis in X2 on your rights side you have 1/3 of total Area .