C. Maximum splitting:题目
这凭啥1300分?
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> a((int)6e5);
vector<ll> b((int)6e5);
string str;
int main()
{
int t;
cin>>t;
while (t--)
{
int n;
cin>>n;
int res = 0;
if (n&1)
{
if (n<9) res = -1;
else
{
if (n<9||n==11) res = -1;
else if ((n-9)%4==0) res = 1+(n-9)/4;
else if ((n-9-6)%4==0) res = 2+(n-9-6)/4;
else res = -1;
}
}
else
{
if (n<4) res = -1;
else if (n%4==0) res = n/4;
else if ((n-6)%4==0) res = 1+(n-6)/4;
else res = -1;
}
cout<<res<<endl;
}
}