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