-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1294C.cpp
More file actions
96 lines (90 loc) · 2.05 KB
/
1294C.cpp
File metadata and controls
96 lines (90 loc) · 2.05 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// HHM
// DATE: 12-07-2022
// TIME:18:05:09
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define dbl double
#define deb(v) cout << #v << " " << v << "\n"
#define deb2(v, k) cout << #v << " " << v << "\n" \
<< #k << " " << k << "\n"
#define vin(name, size) \
for (i = 0; i < size; i++) \
cin >> name[i]
#define vout(name) \
for (i = 0; i < name.size(); i++) \
cout << name[i] << " "; \
cout << endl
#define vec(type1, name) vector<type1> name
#define vp(type1, type2, name) vector<pair<type1, type2>> name
#define st(type, name) set<type> name
#define mpp(type1, type2, name) map<type1, type2> name
#define pb push_back
#define MP make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define part(x, a, b) x.begin() + a, x.begin() + b
#define Pi 3.1415926535897932384626
ll power(ll a, ll b)
{
ll res = 1;
for (ll i = 1; i <= b; i++)
res *= a;
return res;
}
void HHM()
{
ll i, j, k;
ll n;
cin >> n;
ll ans1, ans2, ans3;
bool flag = 0;
for (i = 2; i * i < n; i++)
{
if (n % i == 0)
{
ans1 = i;
for (j = 2; j * j < n / i; j++)
{
if ((n / i) % j == 0 && j != i && (n / i) / j != i)
{
ans2 = j;
ans3 = (n / i) / j;
flag = 1;
break;
}
}
if (flag)
break;
}
}
if (!flag)
cout << "NO\n";
else
{
cout << "YES\n";
cout << ans1 << " " << ans2 << " " << ans3 << "\n";
}
// set<ll>st;
// map<ll,ll>mp;
// string s;cin>>s;
// vector<ll>v(n,0);
return;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll t = 1;
cin >> t;
// ll tt=1;
while (t--)
{
// cout << "Case #" << tt << ": ";
HHM();
// tt++;;
}
}
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);