fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. #define long long int
  4. int main() {
  5. int t;
  6. cin>>t;
  7. while (t--){
  8. int n;
  9. cin>>n;
  10. if(n%2==0) cout<<n/2-1<<endl;
  11. else cout<<n/2<<endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5324KB
stdin
6
7
1
2
3
2000000000
763243547
stdout
3
0
0
1
999999999
381621773