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
- const int MAXN = 1e3;
- void solve(int n) {
- if (n < 23 ) {
- cout << "NO\n";
- return;
- }
- for (int a = 2 ; a < MAXN; a ++) {
- for (int b = a + 1; b < MAXN; b ++) {
- int c = n / (a * b);
- if (a * b * c != n) continue;
- if (a != b && a != c && b != c && c > 1) {
- cout << "YES\n" << a << ' ' << b << ' ' << c << '\n';
- return;
- }
- }
- }
- cout << "NO\n";
- }
- signed main() {
- //freopen(".in", "r" , stdin);
- //freopen(".out", "w" , stdout);
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- int t;
- cin >> t;
- for (int req = 0; req < t; ++req) {
- int n;
- cin >> n;
- solve(n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement