P13046 [HackerEarth] the job party 1
普及
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
2 1 1 3 2 SAMPLE
样例输出
1 3