Advertisement
Mostafizur_Rahman

1551A

Aug 16th, 2022
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.     int t,n;
  6.     cin>>t;
  7.     while(t--)
  8.     {
  9.         cin>>n;
  10.         int s = n/3;
  11.         if(s+2*s==n)
  12.             cout<<s<<" "<<s<<endl;
  13.         else
  14.         {
  15.               if(s+1+2*s==n)
  16.                   cout<<s+1<<" "<<s<<endl;
  17.               else
  18.                   cout<<s<<" "<<s+1<<endl;
  19.         }
  20.  
  21.  
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement