Logo
(追記) (追記ここまで)

30143번 - Cookie Piles 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB84270866685.935%

문제

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?

입력

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 T lines, each line containing the required answer for the corresponding test case.

제한

  • T ≤ 100
  • 1 ≤ N, A, D ≤100

예제 입력 1

3
1 1 1
3 5 6
2 1 2

예제 출력 1

1
33
4

힌트

In the second test case the sequence is: 5, 11, 17 whose sum is 33. See figure.

출처

ICPC > Regionals > Asia West Continent > India > The 2010 ACM-ICPC Asia Amritapuri Regional Contest F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /