Please edit your post and fomat the code correctly. Python needs correct indentation.
If I assume your code is meant like this:
t=int(raw_input())
for i in range(t):
k=int(raw_input())
if k==1:
print "TERM",k,"IS",str(1)+str("/")+str(1)
else:
n=1
while (n*(n+1))/2 < k:
s=(n*(n+1))/2
n=n+1
a=k-s
if n%2==0:
print "TERM",k,"IS",str(n+1-a)+str("/")+str(a)
else:
print "TERM",k,"IS",str(a)+str("/")+str(n+1-a)
then it will deliver the answers in the wrong order ('4/2' instead of '2/4').And you should consider string formatting instead of string concatenation. It will help to generate the desired output format more clearly.