CF 797, got stuck on E and had to leave, went pretty well

This commit is contained in:
2022-06-07 21:38:41 +02:00
parent a2acadbf3e
commit 6de228cf8a
7 changed files with 346 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#include <bits/stdc++.h>
using namespace std;
void test_case(int tc){
int n;
cin >> n;
int result = n / 3 + 2;
if(n % 3 == 0) {
result = n / 3 + 1;
}
int r2 = result - 1;
if(n == 7){
r2 = 2;
}
int lowest = n - result - r2;
cout << r2 << " " << result << " " << lowest << '\n';
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
for(int tc = 1; tc <= t; ++tc){
test_case(tc);
}
cout << flush;
return 0;
}