1335A - Candies Two Sisters
28 Jan 2021 — Tags: None
Click to show code.
using namespace std;
using ll = long long;
ll n;
ll solve(void)
{
ll ans = n - ceil((n + 1) / 2.0);
if (ans == n - ans)
return 0;
return ans;
}
int main(void)
{
int t;
cin >> t;
while (t--)
{
cin >> n;
cout << solve() << endl;
}
return 0;
}