先算出来最小的三个近似质数,那么所组成的和最小就是31,小于31的都不能组成,另外因为不能重复,所以,36,40,44,都要特判一下,把14换成15就行了。
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int N=1e5+5;
const int M=2e4+5;
const double eps=1e-8;
const int mod=1e9+7;
const int inf=0x7fffffff;
const double pi=3.1415926;
using namespace std;
signed main()
{
int t;
cin>>t;
while(t--)
{
int n,a,b,c,d;
cin>>n;
a=6;
b=10;
c=14;
d=30;
d=n-30;
if(d==a||d==b||d==c)
{
c=15;
d-=1;
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
}
else if(d>0)
{
cout<<"YES"<<endl;
cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}