You have just finished a Java certification exam with $n$ questions. Afterwards you receive a score card summarizing your performance. For example, if you answered 78 of 87 questions correctly, the card might look like this:
| Category | Correct answers |
|---|---|
| Basic Concepts | 100% |
| Declarations | 100% |
| Expressions | 83% |
| Classes and Interfaces | 92% |
| Multithreading | 75% |
| Collections | 93% |
The questions are split into $m$ categories (here $m = 6$). Category $i$ contains $n_i$ questions with $1 \le n_i \le n$ and $\sum_{i=1}^{m} n_i = n$. You answered $k$ questions correctly (here $k = 78$, $n = 87$), so the total number of wrong answers is $w = n - k$ (here $w = 9$).
Let $w_i$ (with $0 \le w_i \le n_i$) be the number of wrong answers in category $i$, so that $\sum_{i=1}^{m} w_i = w$. For each category the card shows the percentage of correct answers, namely $100 (n_i - w_i) / n_i$ rounded to the nearest integer; a value whose fractional part is exactly $0.5$ is rounded to the nearest even integer.
The values $w_i$ and $n_i$ are not necessarily determined uniquely by the card. Assuming the questions are distributed among the categories as evenly as possible, we only consider valid assignments of $w_i$ and $n_i$ that minimize the difference between the largest $n_i$ and the smallest $n_i$.
The first line contains three integers $k$, $n$, and $m$: the number of correct answers $k$ ($0 \le k \le n$), the total number of questions $n$ ($1 \le n \le 100$), and the number of categories $m$ ($1 \le m \le 10$). Each of the next $m$ lines contains a single integer between $0$ and $100$ inclusive — the rounded percentage of correct answers in that category. The input always corresponds to at least one valid assignment of $w_i$ and $n_i$.
A valid assignment of $w_i$ and $n_i$ is not always unique, so output the quantity that is uniquely determined: a single integer — the minimum possible value of $\max_i n_i - \min_i n_i$, over all assignments of integers $w_i$ and $n_i$ satisfying $1 \le n_i$, $0 \le w_i \le n_i$, $\sum_{i=1}^{m} n_i = n$, $\sum_{i=1}^{m} w_i = n - k$, and reproducing the given rounded percentage for every category.