fork download
  1. #include <stdio.h>
  2. int main() {
  3. int i, j, x[3], y[3];
  4. scanf("%d",&i);
  5. while(i--){
  6. scanf("%d%d%d%d%d%d",&x[0], &y[0], &x[1], &y[1], &x[2], &y[2]);
  7. printf("%d %d\n", (x[0]==x[1])?x[2]:x[0]+x[1]-x[2], (y[0]==y[1])?y[2]:y[0]+y[1]-y[2]);
  8. }
  9. return 0;
  10. }
  11. /*
  12. int main() {
  13. int i, j, x, y, rx=0, ry=0;
  14. scanf("%d",&i);
  15. while(i--){
  16. scanf("%d%d%d%d",&x, &y,&rx, &ry);
  17. rx = (rx==x)?0:x+rx;
  18. ry = (ry==y)?0:y+ry;
  19. scanf("%d%d",&x, &y);
  20. printf("%d %d\n", (rx==0)?x:rx-x, (ry==0)?y:ry-y);
  21. /*
  22. rx = ry = 0;
  23. j = 3;
  24. while(j--){
  25. scanf("%d%d",&x, &y);
  26. rx += (rx==x)?-x:x;
  27. ry += (ry==y)?-y:y;
  28. }
  29. printf("%d %d\n", (rx==x)?rx:rx-2*x, (ry==y)?ry:ry-2*y);
  30. * /
  31. }
  32. return 0;
  33. }
  34. */
  35. /*
  36. int main() {
  37. int i, j, x[3], y[3];
  38. scanf("%d",&i);
  39. while(i--){
  40. j=3;
  41. while(j--){
  42. scanf("%d%d", x+j, y+j);
  43. }
  44. if(x[0]==x[1]){
  45. printf("%d ",x[2]);
  46. } else {
  47. printf("%d ", x[0]+x[1]-x[2]);
  48. }
  49. if(y[0]==y[1]){
  50. printf("%d\n",y[2]);
  51. } else {
  52. printf("%d\n", y[0]+y[1]-y[2]);
  53. }
  54. }
  55. return 0;
  56. }*/
  57.  
Success #stdin #stdout 0s 2296KB
stdin
2
5 5
5 7
7 5
30 20
10 10
10 20
stdout
7 7
30 10