Because all the problems are so hard these days, this is a very simple problem.
Suppose you are given co-ordinates of two points and in 2D plane, an angle and a stick of length . One end of the stick is in point and it creates degree angle with the line in anti clockwise direction. It means that if one end of the stick is point and another end is point then angle is equal to and Length of is equal to . You have to tell the co-ordinates of the other end point of the stick, that is the co-ordinates of point .
First line will contains (), the number of test cases. Then for each of case, there will be a line containing 6 integers , , , (, , ), () and ().
For each case, print two numbers and , the co-ordinates of the other end point of the stick rounded to the closest integer number in a line.
Input | Output |
---|---|
4 0 0 1 1 45 1 0 0 0 5 90 5 1 2 5 2 180 3 923 557 6907 5317 76 8111 | 1 0 5 5 8 2 10271 -2064 |
This diagram visualizes the first case in this test. |