题解
要让abc不同,我们可以先固定ab取两个较小值,然后看看最大的 c 有没有重复
code
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
int n;
cin>>n;
if(n<7)
{
cout<<"NO\n";
return;
}
if(n%3)
{
int a=1,b=2;
int c=n-3;
cout<<"YES\n";
cout<<a<<' '<<b<<' '<<c<<'\n';
}
else
{
if(n<=9) cout<<"NO\n";
else
{
cout<<"YES\n1 4 "<<n-5<<'\n';
}
}
}
int main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t=1;
cin>>t;
while(t--) solve();
return 0;
}
标签:code,题解,Sum,Three,long,solve
From: https://www.cnblogs.com/pure4knowledge/p/18314299