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

33785번 - High Towers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB95785280.000%

문제

Peter really likes to solve puzzles and his friends know this. They recently asked Peter to solve a well-known puzzle: given a triangular figure of height 3ドル$ (see the figure right), how many triangles pointing upwards are in the figure? Peter solved this problem in no-time so he asked his friends for some harder puzzles. And they came up with the same figure of height 4ドル$ and height 5ドル$ which Peter easily solved.

However, Peter got himself in a bit of trouble when his friends want him to solve the puzzle with a figure of height 6ドル$. Peter still wants to impress his friends with the correct answer, and he wants to be able to solve the puzzles with an even greater height, possibly up to two million! Since he's a very bad programmer, he asked you for help: given the height of the triangle $n,ドル can you determine how many triangles pointing upwards there are visible in the figure?

Figure 1 - A triangle puzzle with height 3. There are 10 upward triangles in this figure.

입력

The input consists of one integer $n$ ($ 1 \leq n \leq 2 \cdot 10^6 $): the height of the triangle.

출력

One integer with the number of triangles pointing upwards in the figure.

제한

예제 입력 1

5

예제 출력 1

35

예제 입력 2

83948

예제 출력 2

98604181205900

힌트

출처

University > Delft University of Technology > Sjaars Kampioenschap Programmeren 2014 H번

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

출처

대학교 대회

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

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