Region
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
In geometry, lines and circles are both very charming shapes, with a lot of interesting properties. We know a line divides the plane into two regions, so does a circle. But how many regions N lines and M circles can divide at most?
Input
The first line contains a single integer T, indicating the number of test cases. Each test case begins with two integers N (0 ≤ N ≤ 1000) and M (0 ≤ M ≤ 1000), indicating the number of lines and circles respectively.
Output
For each case, output one integer, indicating the maximum regions.
Examples
Input #1
Answer #1
Submissions 25
Acceptance rate 60%