logo AlgoBeat OnlineJudge
登录 注册

#216910. [NWERC 2017] Boss Battle

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

题目描述

From Northwestern Europe Regional Contest (NWERC) 2017 Problem B.

Original problem license: CC BY-SA.


You are stuck at a boss level of your favourite video game. The boss battle happens in a circular room with indestructible pillars arranged evenly around the room. The boss hides behind an unknown pillar. Then the two of you proceed in turns.

  • First, in your turn, you can throw a bomb past one of the pillars. The bomb will defeat the boss if it is behind that pillar, or either of the adjacent pillars.
  • Next, if the boss was not defeated, it may either stay where it is, or use its turn to move to a pillar that is adjacent to its current position. With the smoke of the explosion you cannot see this movement.

The last time you tried to beat the boss you failed because you ran out of bombs. This time you want to gather enough bombs to make sure that whatever the boss does you will be able to beat it. What is the minimum number of bombs you need in order to defeat the boss in the worst case? See Figure 1 for an example.

Figure 1

Figure 1: Example for . In this case bombs are enough. Grey pillars represent pillars where the boss cannot be hiding. The bomb is represented in black.

输入格式

The input consists of one line with a single integer (), the number of pillars in the room.

输出格式

Output the minimum number of bombs needed to defeat the boss in the worst case.

样例

样例输入 1

4

样例输出 1

2

样例输入 2

7

样例输出 2

5