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

26550번 - Ornaments 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB48528924760.097%

문제

As a worker at the local mall, you have to set out the Christmas ornaments display. The display setup is a triangular pyramid, with the top layer containing one ball, the second from the top containing three, and so on. Each layer’s side length will be equal to their layer number. Write a program to determine the total number of ornaments in a pyramid, given the number of layers.

입력

The first line will contain a single integer n that indicates the number of data sets that follow. Each data set will consist of a single line containing one integer, denoting the number of layers in the pyramid.

출력

Output the total number of ornaments in the pyramid.

제한

예제 입력 1

2
1
4

예제 출력 1

1
20

힌트

출처

School > PLU High School Programming Contest > PLU 2018 > Novice 7번

School > PLU High School Programming Contest > PLU 2018 > Advanced 7번

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

출처

대학교 대회

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

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