-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1294C.cpp
More file actions
38 lines (36 loc) · 857 Bytes
/
Copy path1294C.cpp
File metadata and controls
38 lines (36 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(int i = 0;i<n;i++)
void solve() {
int n; cin >> n;
set<int> a;
for(int i = 2; i*i <= n; i++){
if(n%i==0){
a.insert(i);
n/=i;
}
if(a.size() == 2){
a.insert(n);
break;
}
}
if(a.count(1) || a.size() != 3){
cout << "NO" << endl;
}
else{
cout << "YES" << endl;
for(auto it : a) cout << it << " ";
cout << endl;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int test = 1;
cin >> test;
while(test--){
solve();
}
return 0;
}