Because all the problems are so hard these days, this is a very simple problem. Suppose you are given co-ordinates of two points A & B in 2D plane, an angle M and a stick of length L. One end of the stick is in point B and it creates M degree angle with the line AB in anti clockwise direction. It means that if one end of the stick is point B and another end is point C then angle B is equal to M and Length of BC is equal to L . You have to tell the co-ordinates of the other end point of the stick, that is the co-ordinates of point C .
First line will contains T, the number of test cases .
Then for each of case, there will be line containing 6 integers Ax, Ay, Bx, By, M and L .
For each case, print two numbers X and Y , the co-ordinates of the other end point of the stick rounded to the closest integer number in a line. See sample test case for better understanding.
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
The figure is given for test case 1.