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.


Added by:Varun Jalan
Date:2010-12-13
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2011-06-26 16:31:29 SPOJ
Tutorial for sure!
2011-05-11 13:03:55 Rohan Kalra
Tutorial!
2010-12-17 16:35:29 Nitin Gangahar
Tutorial!!!
2010-12-16 10:23:01 madhav
the problem is from acm icpc amrita 2010 regionals
2010-12-15 10:12:40 Seshadri R
Such a simple problem. Should be in tutorial section.

Last edit: 2010-12-19 05:45:27
2010-12-15 08:53:24 bryan aldo
yes maybe at Surabaya too ..
2010-12-14 02:47:57 Lukmanul Hakim
Maybe it's bonus problem there, like Problem I at ICPC Asia Jakarta :D

Last edit: 2010-12-15 09:56:46
2010-12-13 12:33:32 .::Manish Kumar::.
Easily qualifies for tutorial.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.