問題一覧 > 通常問題

No.1491 Silver General

レベル : / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 216
作問者 : penguinman / テスター : kaage kichi2004_
お気に入りにしたユーザー ProblemId : 6195 / 自分の提出
問題文最終更新日: 2021-04-27 08:25:12
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 293 (順位表) の他の問題:

Problem Statement

In shogi, there is a piece called the silver general, which moves as follows.

Let us move this piece on an infinitely extending two-dimensional plane.

When the silver general is at coordinates $(x,\ y)$, in $1$ operation you can move it to any one of the following $5$ coordinates (these correspond to the figure above).

  • $(x,\ y+1)$
  • $(x+1,\ y+1)$
  • $(x-1,\ y+1)$
  • $(x+1,\ y-1)$
  • $(x-1,\ y-1)$

Now, the silver general is placed at the origin of the two-dimensional plane. How many coordinates can the silver general reach in at most $K$ operations?

Input

\(K\)

  • $1\leq K\leq 10^9$
  • $K$ is an integer.

Output

Output the number of coordinates the silver general can reach in at most $K$ operations.

Sample

Sample 1
Input
1
Output
6

The figure in the problem statement makes this easy to see.

Sample 2
Input
3
Output
38
Sample 3
Input
998244353
Output
3985967153185554438

The answer can be very large.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。