SPOJ AMR10F Cookies Piles
AMR10F - Cookies Piles
水.
1
2
3 /*************************************************************************
4 > File Name: code/2015summer/#4/F.cpp
5 > Author: 111qqz
6 > Email: rkz2013@126.com
7 > Created Time: 2015年07月29日 星期三 21时47分23秒
8 ************************************************************************/
9
10 #include<iostream>
11 #include<iomanip>
12 #include<cstdio>
13 #include<algorithm>
14 #include<cmath>
15 #include<cstring>
16 #include<string>
17 #include<map>
18 #include<set>
19 #include<queue>
20 #include<vector>
21 #include<stack>
22 #define y0 abc111qqz
23 #define y1 hust111qqz
24 #define yn hez111qqz
25 #define j1 cute111qqz
26 #define tm crazy111qqz
27 #define lr dying111qqz
28 using namespace std;
29 #define REP(i, n) for (int i=0;i<int(n);++i)
30 typedef long long LL;
31 typedef unsigned long long ULL;
32 const int inf = 0x7fffffff;
33 int main()
34 {
35 int T;
36 int n,a,d;
37 cin>>T;
38 while (T--)
39 {
40 scanf("%d %d %d",&n,&a,&d);
41 cout<<n*a+n*(n-1)/2*d<<endl;
42 }
43
44 return 0;
45 }
46
47
48