Java Certification#530

Java Certification

1 second
64 megabytes
Very hard

You have just completed the Java Certification exam, which contained questions. You have a scorecard that explains your performance.

You have correctly answered questions out of .

From this scorecard, you can infer that the questions are divided into categories (in the above example, m = 6). Each category contains n_i questions (1 \leq n_i \leq n), so that

\sum_{i=1}^m n_i = n.

You know that you have correctly answered questions out of (in the example above, k = 78 and n = 87), so you can easily find the number of incorrect answers w = n - k (in the above example, w = 9).

You remember several questions for which you were unsure about the answers and can guess which category they belong to. To find out whether your answers to those questions were right or wrong, you want to know how many incorrect answers you had in each category.

Let w_i (0 \leq w_i \leq n_i) be the number of incorrect answers in the -th category, and

\sum_{i=1}^m w_i = w.

From the scorecard, you know the percentage of correct answers in each category. That is, for each from to , you know the value of

100 \cdot \frac{n_i - w_i}{n_i}

rounded to the nearest integer. A value with a fractional part of is rounded to the nearest even integer.

It may not be possible to uniquely determine the values of w_i and n_i. However, you assume the questions are distributed among the categories as uniformly as possible. Find valid values of w_i and n_i that minimize the difference between the maximum and minimum value of n_i. If there are still multiple possible valid sets of w_i and n_i, output any of them.

Input

The first line contains three integers , , and : the number of correct answers, the total number of questions, and the number of categories (0 \leq k \leq n, 1 \leq n \leq 100, 1 \leq m \leq 10).

The next lines each contain a single integer from to (inclusive): the percentage of correct answers in each category.

The input always corresponds to some valid set of w_i and n_i.

Output

Print lines. On each line, output two integers w_i and n_i: the number of incorrect answers and the total number of questions in the -th category, satisfying the constraints described in the statement.

Examples

Example 1

Loading
Loading