![]() |
||||||||||
|
||||||||||
New GroundTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 861 Accepted Submission(s): 357 Problem Description Your school has a large ground. Recently the school wants a new ground similar to the former one. The ground is a simple polygon. Suppose it has n edges and the old one is A0,A1,…,An-1, the new one is B0,B1,…,Bn-1. They must be one-to-one mapping. The new ground can be only worked out by rotating, expanding, contracting and shifting, but not flipping. Now you know all the points of the old ground, B0, and B1. Can you calculate the other points of the new ground? Input The first line contains one integer T representing the number of test cases. For each case, first line contains one integer n (3<=n<=10000). Then n lines follow. The i-th line has two integers representing the coordinate of the point Ai. (For each 0<=i<j<n, Ai doesn't equals Aj) Following one line contains four integers. The first two integers represent the coordinate of the point B0, and the second two integers represent the coordinate of the point B1. B0 never equals B1. All coordinates are within [-10000, 10000]. The old ground always has a positive area. Output For each test case, in the first line print the case number. Then print n lines followed. The i-th line contains two numbers separated by one space representing the coordinate of the point Bi, rounded to 2 digits after the decimal point. Please follow the format of the sample output. Sample Input
Sample Output
Source | ||||||||||
|