There are two sisters Alice and Betty. You have $n$ candies. You want to distribute these $n$ candies between two sisters in such a way that:  Alice will get $a$ ($a > 0$) candies;  Betty will get $b$ ($b > 0$) candies;  each sister will get some integer number of candies;  Alice will get a greater amount of candies than Betty (i.e. $a > b$);  all the candies will be given to one of two sisters (i.e. $a+b=n$). 

Your task is to calculate the number of ways to distribute exactly $n$ candies between sisters in a way described above. Candies are indistinguishable.

Formally, find the number of ways to represent $n$ as the sum of $n=a+b$, where $a$ and $b$ are positive integers and $a>b$.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 10^4$) — the number of test cases. Then $t$ test cases follow.

The only line of a test case contains one integer $n$ ($1 \le n \le 2 \cdot 10^9$) — the number of candies you have.


-----Output-----

For each test case, print the answer — the number of ways to distribute exactly $n$ candies between two sisters in a way described in the problem statement. If there is no way to satisfy all the conditions, print $0$.


-----Example-----
Input
6
7
1
2
3
2000000000
763243547

Output
3
0
0
1
999999999
381621773



-----Note-----

For the test case of the example, the $3$ possible ways to distribute candies are:  $a=6$, $b=1$;  $a=5$, $b=2$;  $a=4$, $b=3$.

Difficulty: introductory

Starter code:

Solutions:
t = int(input())
for i in range(t):
	n = int(input())
	print((n-1)//2)


for _ in range(int(input())):
    n = int(input())
    print((n-1)//2)


t = int(input())
for q in range(0, t):
    n = int(input())
    if (n % 2 == 0):
        print(n // 2 - 1)
    else:
        print(n // 2)


def solve():
    t = int(input())
    for _ in range(t):
        n = int(input())
        if n % 2 == 0:
            print(n // 2 - 1)
        else:
            print(n // 2)


solve()

from math import *
t = int(input())
for y in range(t):
	n = int(input())
	print((n-1)//2)

# WeirdBugsButOkay

t = int(input())

for wqe in range (0, t) :
    n = int(input())
    if n % 2 == 0 :
        print(n // 2 - 1)
    else :
        print((n - 1) // 2)

t=int(input())
for j in range(t):
  n=int(input())
  if n%2==0:
    print(n//2-1)
  else:
    print(n//2)

import sys
input = sys.stdin.readline
def getInt(): return int(input())
def getVars(): return list(map(int, input().split()))
def getList(): return list(map(int, input().split()))
def getStr(): return input().strip()
## -------------------------------

t = getInt()
for _ in range(t):
    n = getInt()
    if n%2 == 0:
        print(n//2 -1)
    else:
        print(n//2)


t = int(input())
for case_num in range(t):
    n = int(input())
    print((n - 1) // 2)


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]
 
def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))
 
def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))
 
def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD
 
    return (num*(pow(den,MOD-2,MOD)))%MOD
 
def flush():
    return sys.stdout.flush()
 
'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
for _ in range(int(input())):
    n = int(input())
    if n%2:
        print(n//2)
    else:
        print(n//2-1)


for _ in range(int(input())):
    n = int(input())
    if n%2==0:
        print(n//2-1)
    else:
        print(n//2)

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    t = I()
    for _ in range(t):
        n = I()
        print((n-1) >> 1)
    return

#Solve
def __starting_point():
    solve()

__starting_point()

t,*x=map(int,open(0).read().split())
ans=[(y-1)//2 for y in x]
print("\n".join(map(str,ans)))

t=int(input())
for _ in range(t):
    n=int(input())
    print((n-1)//2)

t = int(input())
for i in range(t):
	n = int(input())
	print(n//2 if n%2 == 1 else n//2-1)

from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]


for _ in range(val()):
    n = val()
    print(n//2 if n&1 else n//2 - 1)


t = int(input())
for i in range(t):
    x = int(input())
    if x % 2 == 0:
        print((x-2)//2)
    else:
        print((x-1)//2)

    


t=int(input())
for i in range(t):
    n = int(input())
    print((n-1)//2)

import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy

ORDA = 97
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return [int(i) for i in input().split()]
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def revn(n): return str(n)[::-1]
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
def divs(n, start=1):
    r = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if (n % i == 0):
            if (n / i == i):
                r.append(i)
            else:
                r.extend([i, n // i])
    return r
def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
def prime(n):
    if n == 2: return True
    if n % 2 == 0 or n <= 1: return False
    sqr = int(math.sqrt(n)) + 1
    for d in range(3, sqr, 2):
        if n % d == 0: return False
    return True
def convn(number, base):
    newnumber = 0
    while number > 0:
        newnumber += number % base
        number //= base
    return newnumber
def cdiv(n, k): return n // k + (n % k != 0)


for i in range(ii()):
    n = ii()
    if n & 1:
        print(n // 2)
    else:
        print(n // 2 - 1)

t = int(input())
for _ in range(t):
    print((int(input())-1)//2)

from sys import stdin, exit, setrecursionlimit
setrecursionlimit(10000000)

input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

for _ in range(int(input())):
    n = int(input())
    print((n-1)//2)