Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

B. Math Show

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputPolycarp takes part in a math show. He is given *n* tasks, each consists of *k* subtasks, numbered 1 through *k*. It takes him *t*_{j} minutes to solve the *j*-th subtask of any task. Thus, time required to solve a subtask depends only on its index, but not on the task itself. Polycarp can solve subtasks in any order.

By solving subtask of arbitrary problem he earns one point. Thus, the number of points for task is equal to the number of solved subtasks in it. Moreover, if Polycarp completely solves the task (solves all *k* of its subtasks), he recieves one extra point. Thus, total number of points he recieves for the complete solution of the task is *k* + 1.

Polycarp has *M* minutes of time. What is the maximum number of points he can earn?

Input

The first line contains three integer numbers *n*, *k* and *M* (1 ≤ *n* ≤ 45, 1 ≤ *k* ≤ 45, 0 ≤ *M* ≤ 2·10^{9}).

The second line contains *k* integer numbers, values *t*_{j} (1 ≤ *t*_{j} ≤ 1000000), where *t*_{j} is the time in minutes required to solve *j*-th subtask of any task.

Output

Print the maximum amount of points Polycarp can earn in *M* minutes.

Examples

Input

3 4 11

1 2 3 4

Output

6

Input

5 5 10

1 2 4 8 16

Output

7

Note

In the first example Polycarp can complete the first task and spend 1 + 2 + 3 + 4 = 10 minutes. He also has the time to solve one subtask of the second task in one minute.

In the second example Polycarp can solve the first subtask of all five tasks and spend 5·1 = 5 minutes. Also he can solve the second subtasks of two tasks and spend 2·2 = 4 minutes. Thus, he earns 5 + 2 = 7 points in total.

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/29/2020 19:03:44 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|