Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- const int LOVE = 1411;
- ll T, L, R, m, n;
- bool check(ll x){
- if(x >= max(1ll, m + L - R) && x <= m - L + R){
- cout << L + n << ' ';
- if(x <= m)
- cout << L + m - x << ' ' << L << '\n';
- else
- cout << L << ' ' << L + x - m << '\n';
- return 0;
- }
- return 1;
- }
- int main(){
- cin >> T;
- while(T--){
- cin >> L >> R >> m;
- for(n = 0; check(m/(L + n)*(L + n)) && check(m/(L + n)*(L + n) + L + n); ++n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment