#BS0000023. Tấn công diện rộng (Widespread)
Tấn công diện rộng (Widespread)
Widespread
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
There are monsters with health . In one explosion, choose one alive monster as the center. It loses health and every other alive monster loses health, where . Find the minimum number of explosions needed to eliminate all monsters.
Input
The first line contains . The next lines contain .
Output
Print the minimum number of explosions.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: , , .
Examples
Input
4 5 3
8
7
4
2
Output
2
Explanation
Initially the health values are .
- Center the first explosion at the monster with health . The values become , so the last monster vanishes.
- Center the second explosion at the monster with health . The remaining values become , so all monsters vanish.
Thus two explosions are sufficient, and one explosion is not.