Saleh127

CF 1372B

Jul 11th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 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.  
  10. test
  11. {
  12. ll a,c,d,e=0,f,i,j,k;
  13. cin>>a;
  14. if(a%2==0)
  15. {
  16. cout<<a/2<<" "<<a/2<<endl;
  17. }
  18. else
  19. {
  20. for(i=2;i*i<=a;i++)
  21. {
  22. if(a%i==0)
  23. {
  24. d=a/i;
  25. e=1;
  26. break;
  27. }
  28. }
  29. if(e==0) cout<<1<<" "<<a-1<<endl;
  30. else cout<<d<< " "<<a-d<<endl;
  31. }
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment