Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- signed main()
- {
- int t , n;
- cin >> t;
- while(t--){
- cin >> n;
- int a = 1 , b = 1 , c = 1;
- for(int i = 2; (i * i) <= n; i++){
- if(n % i == 0){
- a = i;
- break;
- }
- }
- if(a == 1){
- cout << "NO" << endl;
- continue;
- }
- n /= a;
- for(int i = (a + 1); (i * i) <= n; i++){
- if(n % i == 0){
- b = i;
- break;
- }
- }
- if(b == 1){
- cout << "NO" << endl;
- continue;
- }
- c = n / b;
- if(c > b){
- cout << "YES" << endl;
- cout << a << " " << b << " " << c << endl;
- }else{
- cout << "NO" << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement