Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. int main()
  3. {
  4. int m, n, x, z, y;
  5. scanf("%d", &n);
  6. if (n==1)
  7. {
  8. x=-1;
  9. printf("%d\n", x);
  10. fflush(stdout);
  11. }
  12. else
  13. {
  14. if (n%2==0)
  15. {
  16. printf("%d\n%d\n%d\n", 2, n/2, n/2+1);
  17. fflush(stdout);
  18. }
  19. else
  20. {
  21. printf("%d\n%d\n%d\n%d\n", 3, (n-1)/2, (n+1)/2, (n+3)/2);
  22. fflush(stdout);
  23. }
  24. while (true)
  25. {
  26. scanf("%d", &m);
  27. if (m==-1) break;
  28. if (m==3)
  29. {
  30. scanf("%d%d%d", &x, &z, &y);
  31. printf("%d\n%d\n%d\n%d\n", m, n-y+1, n-z+1, n-x+1);
  32. fflush(stdout);
  33. }
  34. else
  35. {
  36. scanf("%d%d", &x, &z);
  37. printf("%d\n%d\n%d\n", m, n-z+1, n-x+1);
  38. fflush(stdout);
  39. }
  40. }
  41.  
  42.  
  43. }
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement