J.Prime
maybe也是水题
题目描述
Give you a positive integer nn, can you find four prime numbers aa, bb, cc and dd satisfied that a + b + c + d = n and minimizing min(a, b, c, d)?
a, b, c, d are allowed to be the same prime number.
输入格式
The first line contains an integer T for test cases.
Next T lines, each line has an integer n.
1≤T≤105
1≤n≤231
输出格式
For each test case, output an integer to represent the minimum value of min(a, b, c, d)min(a,b,c,d). If it does not exist, you just need to output -1.
输入输出样例
输入 #1
2
1
8
输出 #1
-1
2
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int t;
ll n;//开long long
cin>>t;
while(t--)
{
cin>>n;
if(n<8) cout<<"-1"<<endl;
else cout<<"2"<<endl;
}
return 0;
}
int的取值范围是-231 ~231-1 ,也就是 -2147483648 ~ - 2147483647
所以 n 要开long long(我们一开始就是因为没开long long 错的)