You will be given an isosceles right angled triangle. The legs of the triangle have a length of and lies along the positive axis and axis. You can assume that the coordinates of the three vertices of the triangle are , and .
Your task is to divide the triangle into two sections of equal area by drawing a straight line segment starting from a point on the perimeter to another point on the perimeter of the triangle.
However, there is a small twist. You cannot just draw the line from any point. You will be given the starting point of the segment on the perimeter. You have to find the coordinate of the other end of that segment.
The first line contains an integer (), the number of test cases. For each test case, there are three integers, , , . Here, () is the length of the legs, and is the coordinate of starting point of the segment.
For each case, print the coordinate of the other end point of the segment. An error lower than will be ignored by the judge. Check sample input and output section for formatting.
Input | Output |
---|---|
2 250 0 0 250 0 40 | 125.000000 125.000000 148.809524 101.190476 |