|
||||||||||
RotateTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1515 Accepted Submission(s): 667 Special Judge Problem Description Noting is more interesting than rotation! Your little sister likes to rotate things. To put it easier to analyze, your sister makes n rotations. In the i-th time, she makes everything in the plane rotate counter-clockwisely around a point ai by a radian of pi. Now she promises that the total effect of her rotations is a single rotation around a point A by radian P (this means the sum of pi is not a multiplier of 2¦Ð). Of course, you should be able to figure out what is A and P :). Input The first line contains an integer T, denoting the number of the test cases. For each test case, the first line contains an integer n denoting the number of the rotations. Then n lines follows, each containing 3 real numbers x, y and p, which means rotating around point (x, y) counter-clockwisely by a radian of p. We promise that the sum of all p's is differed at least 0.1 from the nearest multiplier of 2¦Ð. T<=100. 1<=n<=10. 0<=x, y<=100. 0<=p<=2¦Ð. Output For each test case, print 3 real numbers x, y, p, indicating that the overall rotation is around (x, y) counter-clockwisely by a radian of p. Note that you should print p where 0<=p<2¦Ð. Your answer will be considered correct if and only if for x, y and p, the absolute error is no larger than 1e-5. Sample Input
Sample Output
Source | ||||||||||
|