fork download
  1. r = list()
  2. n = int(input())
  3. for i in range(n):
  4. x = int(input())
  5. if(x<=2):
  6. r.append(0)
  7. else:
  8. r.append((x-1)//2)
  9.  
  10. for it in r:
  11. print(it)
  12.  
  13.  
Success #stdin #stdout 0.02s 9400KB
stdin
6
7
1
2
3
2000000000
763243547
stdout
3
0
0
1
999999999
381621773