logo AlgoBeat OnlineJudge
登录 注册

#214081. [VKOSHP 2024] Colony of Bacteria

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Scientists have discovered a new species of bacteria and have begun conducting experiments to study it.

In one of the experiments, they placed a colony of bacteria on an infinite grid, and it turned out that it expands every second. In every even second, the colony expands in eight directions, meaning it occupies cells adjacent to the occupied ones both orthogonally and diagonally, if they are not already occupied. In odd seconds, it only expands in four directions, occupying cells adjacent to the occupied ones orthogonally.

Help the scientists determine how many cells are occupied by the colony of bacteria at the -th second of the experiment, given that it was placed on the grid in the first second.

输入格式

The first line contains an integer --- the time in seconds when the scientists want to know how many cells are occupied by the colony of bacteria ().

输出格式

Output a single number -- the number of cells occupied by the colony of bacteria at the -th second of the experiment.

样例

样例输入 1

1

样例输出 1

1

样例输入 2

2

样例输出 2

9

样例输入 3

3

样例输出 3

21

样例输入 4

4

样例输出 4

45

样例输入 5

5

样例输出 5

69

数据范围与提示

The filling of the grid for the first five seconds, with the cell indicating the second when this cell will first be occupied by the colony of bacteria.