http://www.codechef.com/problems/SNCK04/==>Link to question
import psyco
psyco.full()
test_case_input=input()
for i in range(test_case_input):
inp=input()
t=[(x, y) for x in range(1,inp+1) for y in range(1,inp+1) if x<y]
print(len(t))
http://www.codechef.com/problems/SNCK04/==>Link to question
import psyco
psyco.full()
test_case_input=input()
for i in range(test_case_input):
inp=input()
t=[(x, y) for x in range(1,inp+1) for y in range(1,inp+1) if x<y]
print(len(t))