#include <bits/stdc++.h>
using namespace std;
int main()
{
long long t;
cin>>t;
while(t--)
{
long long k,d=0;
cin>>k;
long long a[10000] ;
for ( int i=0 ; i < k ; i++ )
{
a[i] = i+1;
}
long long slow = 0 ;
for ( long long fast=1; fast<k-1;fast++)
{
if ( a[slow] < a[fast] )
{
if ( (a[slow] + a[fast]) == k )
{
slow++;
fast=0;
d++;
}
if ( ( a[slow] + a[fast] ) < k )
{
d++;
}
}
}
d=d-slow;
cout<<d<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkKewoJbG9uZyBsb25nIHQ7CgljaW4+PnQ7Cgl3aGlsZSh0LS0pCgl7CgkJbG9uZyBsb25nIGssZD0wOwoJCWNpbj4+azsKCQlsb25nIGxvbmcgYVsxMDAwMF0gOwoJCWZvciAoIGludCBpPTAgOyBpIDwgayA7IGkrKyApCgkJewoJCQlhW2ldID0gaSsxOwoJCX0KCQlsb25nIGxvbmcgc2xvdyA9IDAgOwoJCWZvciAoIGxvbmcgbG9uZyBmYXN0PTE7IGZhc3Q8ay0xO2Zhc3QrKykKCQl7CgkJCgkJCWlmICggYVtzbG93XSA8IGFbZmFzdF0gKQoJCQl7CgkJCWlmICggKGFbc2xvd10gKyBhW2Zhc3RdKSA9PSBrICkKCQkJCXsKCQkJCQlzbG93Kys7CgkJCQkJZmFzdD0wOwoJCQkJCWQrKzsKCQkJCX0KCQkJaWYgKCAoIGFbc2xvd10gKyBhW2Zhc3RdICkgPCBrICkKCQkJCXsKCQkJCQlkKys7CgkJCQl9CgkJCX0KCQkJCgkJfQoJCWQ9ZC1zbG93OwoJCWNvdXQ8PGQ8PGVuZGw7Cn0KCQlyZXR1cm4gMDsKfQ==
OTYKNjcyMQoxMzQxCjIyOTYKOTQ0NQo4NTE3Cjc2MDEKOTk2MQo3NzI5CjQxMDEKNDU1MQoxMzc3CjIwMDEKMzcxOQo5MTQ1CjM4MzEKNzEyNgoyODQ1CjE5NjkKODM2OQo0MjQxCjYyODMKNDAxNwo5ODc2CjY2MDkKNTAyNQo3NTM3CjIxNzEKNjQzMwo1OTA3CjY0ODEKMzAxCjUwNjEKMzE1MwozMTA1CjMxMzcKNjEwMwo3MzA1CjY0NjEKNjY3Mwo0NTk3CjY3MjYKMQoyMTE1CjMyMDEKNjM4NQo4NzA1CjE1NjkKOTc5Mwo2NzEwCjM0NjkKMjQ3Nwo3Mzc3CjQzOTMKMjcxMwo0MzY1CjU5NTkKNzEyNgo3OTU5Cjk2MDkKMzEzNwo0OTQ5CjgzNzMKMjg3Ngo5ODc3CjI3MDAKMzU4MQo4NjI2CjQ3MDEKNzI0MwoxODc2Cjk2MDEKNzc4OQoyNjIxCjk4MTcKMjY4OQo3MDgxCjQ4NTcKMzkxMQozOTAxCjUzMTMKMjM2OQo0OTYzCjc1NTMKNzA0MQoyMzEzCjg0MDEKMjExMwo1NQoyNzY5CjU3MQo0NTEzCjUxODMKNTA3Mwo2Mjc1CjUwMDEKNDg1Cg==
96
6721
1341
2296
9445
8517
7601
9961
7729
4101
4551
1377
2001
3719
9145
3831
7126
2845
1969
8369
4241
6283
4017
9876
6609
5025
7537
2171
6433
5907
6481
301
5061
3153
3105
3137
6103
7305
6461
6673
4597
6726
1
2115
3201
6385
8705
1569
9793
6710
3469
2477
7377
4393
2713
4365
5959
7126
7959
9609
3137
4949
8373
2876
9877
2700
3581
8626
4701
7243
1876
9601
7789
2621
9817
2689
7081
4857
3911
3901
5313
2369
4963
7553
7041
2313
8401
2113
55
2769
571
4513
5183
5073
6275
5001
485