Arithmetic progression
Execution time limit is 4 seconds
Runtime memory usage limit is 64 megabytes
You are given an arithmetic progression consisting of elements, where the -th element .
Your task is to calculate the sum of the arithmetic progression given , , and .
Input
The first line contains one integer — the number of test cases.
The next lines contain four integers , , and each — description of arithmetic progression.
Output
For each test example, print on a separate line a single number — the sum of the elements of the arithmetic progression.
Examples
Input #1
Answer #1
Submissions 54
Acceptance rate 15%