Vegetarian Pool Divider
Time limit1sMemory limit128 MB
Given one endpoint on the boundary of a fixed right isosceles triangle, compute the other endpoint of a segment that splits the triangle into two equal-area regions.
- Level
Medium5 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
Sangbeom built a right isosceles triangular swimming pool on the coordinate plane. Both legs have length 250, and the vertices are (0, 0), (250, 0), and (0, 250).

The pool must be divided into two regions by one line segment whose endpoints both lie on the sides of the triangle. The two regions must have equal area.
Given one endpoint of such an area-bisecting segment, find the coordinates of the other endpoint.
Input
The first line contains the coordinates x y of one endpoint of the segment. This point is always on a side of the triangle.
Output
Print the x y coordinates of the other endpoint rounded to two decimal places.