Ator Ali loves to make money. He does not care whether his source of income is good or evil. As his intention is not clear, he can not find any honest way to make the money. As a result, all his income sources are illegal.
Ator Ali doesn't know that a group is secretly observing his income pattern and they are keeping track of it. The group has set a penalty amount against his monthly income. When the right time comes, they will send him a legal notice and demand the penalty amount from him. After a few months, their analyst figured that Ator Ali's income increases by after every month. So there is no need to store the exact income of Ator Ali after each month. Instead, his income after any month can be calculated from his first month’s income and the value of . As there are many dishonest persons in society, the group is busy keeping track of the income of a lot of people. So they need your help to calculate the income of Ator after the month.
The first line of the input will contain an integer that denotes the number of test cases. Then for each test case there will be an integer which denotes the number of queries we want to make. Then for each query, there will be three positive integers , , ( ) that denotes Ator Ali's income of the first month from when the group started tracking his income, the increased amount of income between any two consecutive months and the month on which they want to calculate Ator Ali’s income respectively.
For each input, output the amount of money earned by Ator Ali on the n-th month.
1 1 10 5 6
Login to submit
To solve this problem, the main task is to calculate the income of Ator in any month. As we know the...