Saleh127

cf 1379B

Jul 19th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9. test
  10. {
  11. ll l,r,m,a=0,c,d,e,f,g,i,j,k;
  12. cin>>l>>r>>m;
  13. for(i=l;i<=r;i++)
  14. {
  15. c=m%i;
  16. if(m>=i && c<=r-l)
  17. {
  18. cout<<i<<" "<<l+c<<" "<<l<<endl;
  19. break;
  20. }
  21. d=i-c;
  22. if(d==i) d=0;
  23. if(d<=r-l)
  24. {
  25. cout<<i<<" "<<r-d<<" "<<r<<endl;
  26. break;
  27. }
  28. }
  29. }
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment