Vegetarian Pool Divider

Time limit1sMemory limit128 MB

Summary
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.

Examples3

  1. Example 1

    Input
    0 0
    
    Expected output
    125.00 125.00
    
  2. Example 2

    Input
    230 20
    
    Expected output
    0.00 114.13
    
  3. Example 3

    Input
    0 40
    
    Expected output
    148.81 101.19