+ **Time limit:** 1 second
+ **Memory limit:** 256 MB
Grandmother wants to grow **sprouted greens**. She has set aside $k$ lentil seeds and prepared a tray with $n$ suitable positions for the seeds. The positions are numbered from left to right from $1$ to $n$. The seeds must be planted with proper spacing, and each position can hold at most one seed.
|  |
|:---------------------------------------------------------------:|
| Sabzeh symbolizes vitality and growth. |
If two seeds are planted in consecutive positions, their growth will be hindered. Grandmother wants to place $k$ seeds in $n$ positions so that the number of such consecutive pairs is minimized. In other words, she wants to plant the seeds so that the number of integers $i$ with $1 \leq i \leq n-1$ for which both positions $i$ and $i+1$ have seeds is as small as possible.
Grandmother needs your help to calculate this minimum number.
# Input
The first line contains two integers $n$ and $k$, respectively.
# Output
Print a single line containing the **minimum number of consecutive position pairs** that have seeds in both positions.
# Examples
## Sample Input 1
```
5 2
```
## Sample Output 1
```
0
```
**Explanation:**
Grandmother can plant her two seeds in positions 1 and 4. No two seeds are adjacent.
## Sample Input 2
```
5 4
```
## Sample Output 2
```
2
```
**Explanation:**
Grandmother can plant her four seeds in positions 1, 2, 3, and 5. The adjacent pairs are $(1,2)$ and $(2,3)$, so the minimum number of consecutive pairs with seeds is 2.
Post an answer to this question
You currently do not have access.