Saleh127

cf 1285C

Jun 21st, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 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 Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. ll lcm(ll a,ll c)
  7. {
  8. return (a*c)/__gcd(a,c);
  9. }
  10. int main()
  11. {
  12. Faster
  13.  
  14. ll a,c,d,e,f,i,j,k,l,x;
  15.  
  16. cin>>x;
  17. for(i=1;i*i<=x;i++)
  18. {
  19. if(x%i==0 && lcm(i,x/i)==x)
  20. {
  21. d=i;
  22. }
  23. }
  24. cout<<d<< " "<<x/d<<endl;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment