• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. struct data
    5. {
    6. int x, y;
    7. } typedef toado;
    8.  
    9. int main ()
    10. {
    11. long long n, j;
    12. cin>>n>>j;
    13. toado M0;
    14. cin>>M0.x>>M0.y;
    15. toado A[200005];
    16. for (int i=1; i<=n; i++)
    17. {
    18. cin>>A[i].x>>A[i].y;
    19. A[n+i].x = A[i].x;
    20. A[n+i].y = A[i].y;
    21. }
    22. if (j%(2*n)==0) cout<<M0.x<<" "<<M0.y;
    23. else
    24. {
    25. j=j%(2*n);
    26. toado M_j;
    27. for (int i=1; i<=j; i++)
    28. {
    29. M_j.x=2*A[i].x-M0.x;
    30. M_j.y=2*A[i].y-M0.y;
    31.  
    32. M0.x=M_j.x;
    33. M0.y=M_j.y;
    34. }
    35. cout<<M_j.x<<" "<<M_j.y;
    36. }
    37. return 0;
    38. }