n = int(input()) for i in range (n): m = input().split() s = int(m[0]) e = int(m[1]) if s > e: s,e = e,s t = 0 for j in range (s+1, e): if j % 2: t += j print (t)