AtCoder Beginner Contest 134
B
Golden Apple
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

There are $N$ apple trees in a row. People say that one of them will bear golden apples.

翻译中…

We want to deploy some number of inspectors so that each of these trees will be inspected.

翻译中…

Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from $1$ through $N$ to the trees. An inspector deployed under the $i$-th tree $(1 \leq i \leq N)$ will inspect the trees with numbers between $i-D$ and $i+D$ (inclusive).

翻译中…

Find the minimum number of inspectors that we need to deploy to achieve the objective.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \leq N \leq 20$
  • $1 \leq D \leq 20$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N D

翻译中…

Output

翻译中…

Print the minimum number of inspectors that we need to deploy to achieve the objective.

翻译中…

样例

Input #1
6 2
Output #1
2
We can achieve the objective by, for example, placing an inspector under Tree $3$ and Tree $4$.
Input #2
14 3
Output #2
2
Input #3
20 4
Output #3
3
题目信息
题号
abc134_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。