t = input()
for a0 in xrange(t):
    u, v = map(int, raw_input().split())
    t = u + v
    print(t * (t + 1) / 2) + u + 1

b4af04f8667b6992f3da0c17f130537a92e8fb51
<mask token>

<mask token>
for a0 in xrange(t):
    u, v = map(int, raw_input().split())
    t = u + v
    print(t * (t + 1) / 2) + u + 1

t = input()
for a0 in xrange(t):
    u, v = map(int, raw_input().split())
    t = u + v
    print(t * (t + 1) / 2) + u + 1
