Skip to content

Commit f4c3e55

Browse files
committed
Polycarp and Coins
1 parent e06219d commit f4c3e55

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

1551A.CPP

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
int t;
6+
cin>>t;
7+
int n;
8+
while(t--){
9+
cin>>n;
10+
int c1 = 0, c2 = 0;
11+
if(n%3 == 0){
12+
cout<<n/3<<" "<<n/3<<endl;
13+
continue;
14+
}
15+
if(n%3 == 1){
16+
cout<<(n/3 + 1)<<" "<<n/3<<endl;
17+
continue;
18+
}
19+
cout<<(n/3)<<" "<<(n/3 + 1)<<endl;
20+
}
21+
}

0 commit comments

Comments
 (0)