Advertisement
Promi_38

cf 1551A

Sep 25th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int t;
  8.     scanf("%d", &t);
  9.     while(t--)
  10.     {
  11.         long long n;
  12.         scanf("%lld", &n);
  13.         if(n % 3 == 0) printf("%lld %lld\n", n/3, n/3);
  14.         else if(n % 3 == 1) printf("%lld %lld\n", (n/3)+1, n/3);
  15.         else if(n % 3 == 2) printf("%lld %lld\n", n/3, (n/3)+1);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement