#Lutece0332. Sequence of points
Sequence of points
Migrated from Lutece 332 Sequence of points
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
You are given the following points with integer coordinates on the plane: , where is odd number. Now we define the following infinite sequence of points : is symmetric to according (for every natural number ). Here point is symmetric to according , if is the center of the line segment . Given index find the point .
Input
There are multi-cases. On the first line of each case, you will be given an integer (), which will be odd, and (), where is the index of the desired point. The next line contains two space separated integers, the coordinates of . After that lines follow, where the line contain the space separated integer coordinates of the point . The absolute values of all input coordinates will not be greater then .
Output
For each case output the coordinates of , space separated.
Samples
3 4
0 0
1 1
2 3
-5 3
3 1
5 5
1000 1000
-1000 1000
3 100
14 0
1995 1995
Resources
2011寒假训练(一)(Not Original)