C. Product of Three Numbers【1300 / 简单数论】
作者:互联网
https://codeforces.com/problemset/problem/1294/C
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int t; cin>>t;
while(t--)
{
int n; cin>>n;
bool flag=0;
for(int i=2;i<=n/i;i++)
{
if(n%i==0)
{
int temp=n/i;
for(int j=2;j<=temp/j;j++)
{
if(temp%j==0)
{
int a=i,b=j,c=temp/j;
if(a==b||a==c||b==c) continue;
puts("YES");
cout<<j<<" "<<temp/j<<" "<<i<<endl;
flag=1;
break;
}
}
}
if(flag) break;
}
if(!flag) puts("NO");
}
return 0;
}
标签:Product,1300,cout,temp,int,Three,temp%,cin 来源: https://blog.csdn.net/bettle_king/article/details/121171900