AMR10F  Cookies Piles
The kids in my son's kindergarten made Christmas cookies with their teacher, and piled them up in columns. They then arranged the columns so that the tops of the columns, going from shortest to tallest, were in a nice straight ramp. The cookies were all of uniform size. Given that there were A cookies in the shortest pile, that the difference in height between any two adjacent piles was D cookies, and that there were N piles, can you write a program to figure out how many cookies there were in total?
INPUT
The first line contains the number of test cases T. T lines follow, one corresponding to each test case, containing 3 integers : N, A and D.
OUTPUT
Output T lines, each line containing the required answer for the corresponding test case.
CONSTRAINTS
T <= 100
1 <= N, A, D <=100
SAMPLE INPUT
3
1 1 1
3 5 6
2 1 2
SAMPLE OUTPUT
1
33
4
EXPLANATION
In the second test case the sequence is: 5, 11, 17 whose sum is 33.
hide comments
pantd70:
20161010 14:39:02
The main intension of problem is to make use of loop 

Dushyant Singh:
20150618 19:42:58
TLE in first attemp! *_* 

akhil_sharma:
20120620 07:11:48
WTF....this is spoj or smthing else Last edit: 20120620 07:12:24 

ginnipkj:
20120608 13:02:58
add to tutorial plz...........


Aradhya:
20111230 15:56:11
vry simple problem....plzzz move 2 tutorial.. by seeing this prb I wonder that I am doing spoj or smthng else!!!...solvd in 1 min...lolzzzz!!! 

PubLic_AvenGeR:
20111228 17:56:59
too easy..move to tutorial plz.. 

H. Gilles:
20111227 23:37:35
http://en.wikipedia.org/wiki/Arithmetic_progression Last edit: 20111227 23:45:50 

张翼德:
20111209 13:25:47
I clicked on classical.. how the hell did I got redirected to tutorial _ Last edit: 20111209 13:26:32 

Mr. Rook:
20111004 11:45:09
add this one to tutorial 

Amit Chowdhary:
20110910 12:37:55
Why am I getting a w/a here?? This is irritating, program seems to be working fine. :( 
Added by:  Varun Jalan 
Date:  20101213 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 