Raman got placed in AWS. He is organizing his job party in which N number of people are invited and only K people joined the party.

Ofcourse, Raman is also present in the party!

K ≤ N

In the party everyone starts shaking hands with everyone else. Given, any two persons shake hand exactly once.

Can you tell the total number of handshakes ? 

Input Format

The first line contains the number of test-cases T, T lines follow.

Each line then contains integer N (the total number of invites sent by Raman) and space separated integer K (the total number of people joined the party)

Output Format

Print the number of handshakes for each test-case in a new line

Constraints

1 ≤ T ≤ 1000

0 < K ≤ N < 10^6

SAMPLE INPUT
2
1 1
3 2

SAMPLE OUTPUT
1
3

Explanation

Case 1 : Only one person comes to the party. That is one handshake.
Case 2 : Two people come to the party. Therefore total handshakes equals 3
t=int(raw_input())
while t:
	t-=1
	n,k=map(int,raw_input().split())
	print k*(k+1)/2