Saleh127

CF 1294C.cpp

Jun 29th, 2020
158
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. test
  10. {
  11. ll a,c=0,d=0,e=0,f,i,j,k,l;
  12. cin>>a;
  13. for(i=2;i*i<=a;i++)
  14. {
  15. if(a%i==0)
  16. {
  17. c=i;
  18. a/=i;
  19. break;
  20. }
  21. }
  22. for(i=c+1;i*i<a;i++)
  23. {
  24. if(a%i==0)
  25. {
  26. d=i;
  27. e=a/i;
  28. }
  29. }
  30. if(d==0 || e==0 || c==0) cout<<"NO"<<endl;
  31. else cout<<"YES"<<endl<<c<<" "<<d<<" "<<e<<endl;
  32. }
  33.  
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment