아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Ornaments

시간 제한1초메모리 제한1024 MB

요약
각 데이터 세트마다 주어진 층수를 가진 삼각뿔 장식의 총 구슬 개수를 계산한다.
난이도

보통10점 중 4점

유형
수학, 구현
정답자
아직 제출이 없습니다

문제

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

  1. 예제 1

    입력
    2
    1
    4
    
    예상 출력
    1
    20