fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4.  
  5. int32_t main() {
  6. ios::sync_with_stdio(false);
  7. cin.tie(NULL);
  8.  
  9. int t;
  10. cin>>t;
  11. while(t--){
  12. int n;
  13. cin>>n;
  14. if(n%2==0) cout<<n/2<<" "<<n/2<<endl;
  15. else if(n%3==0) cout<<n/3<<" "<<2*n/3<<endl;
  16. else cout<<1<<" "<<n-1<<endl;
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5268KB
stdin
3
4
6
9
stdout
2 2
3 3
3 6