Advertisement
Ahmed_Negm

D

May 27th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<iostream>
  3. #include<cmath>
  4. #include<iomanip>
  5. #include<algorithm>
  6. #include<cstdlib>
  7. #include<cstring>
  8. #include<vector>
  9. #include<utility>
  10. using namespace std;
  11.  
  12. #define ll long long
  13. #define nl '\n'
  14. #define sz(x) int(x.size())
  15. #define all(x) x.begin(),x.end()
  16. #define rall(s)  s.rbegin(), s.rend()
  17. #define getline(s) getline(cin>>ws,s)
  18. #define ceill(n, m) (((n) / (m)) + ((n) % (m) ? 1 : 0))
  19. #define pi  3.141592653589793
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. void solve(){
  27.   ll n,a,b; cin>>n>>a>>b;
  28.   ll x = n/(max(a,b));
  29.   n%=(max(a,b));
  30.   ll y = n/(min(a,b));
  31.   if(max(a,b) == b) swap(x,y);
  32.   cout<<x<<' '<<y<<nl;
  33.  
  34.  
  35. }
  36.  
  37. int main(){
  38. ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  39. freopen("tank.in", "r", stdin);
  40. int t =1;
  41. cin>>t;
  42. while(t--){
  43. solve();
  44. }
  45. return 0;
  46. }  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement