You will be given a positive integer K. Your task is to find the number of ordered pairs of positive integers (a,b) where 1 ≤ a < b < K such that a + b ≤ K.
The first line of input contains a single integer T denoting the number of test cases.Then T test cases follow. The first and only line of each test case consists of K.
Corresponding to each test case, in a new line, print the number of ordered pairs of positive integers (a,b) where 1 ≤ a < b < K such that a + b ≤ K.
1 ≤ T ≤ 100
1 ≤ K ≤ 1000
For K = 4, the two ordered pairs are (1,2) and (1,3). For K = 5, the four ordered pairs (1,2), (1,3), (1,4) and (2,3).
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.