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 .
The first line contains one integer — the number of test cases.
The next lines contain four integers , , and each — description of arithmetic progression.
For each test example, print on a separate line a single number — the sum of the elements of the arithmetic progression.