5.23 VJ E - Candies and Two Sisters

#include<bits/stdc++.h>
#define ll long long
using namespace std;
/*
题意:A和B两人分n个糖,每人最少一个,且A分得的数量要大于B,只要分奇偶情况输出就行
*/
int main()
{
    ll t,n;
    cin>>t;
    for(int i=0;i<t;i++)
    {
        cin>>n;
        if(n%2==0)
        {
            cout<<n/2-1<<endl;
        }
        else{
            cout<<n/2<<endl;
        }
    }
}
posted @ 2020-05-23 12:11  SyrupWRLD  阅读(133)  评论(0)    收藏  举报