Polycarp 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·109).
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.
[samples]
## 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.
Let $ n $ be the number of tasks, $ k $ the number of subtasks per task, and $ M $ the total available time.
Let $ t_1, t_2, \dots, t_k $ be the time required to solve subtask $ j $ (same for all tasks).
Define:
- A **partial solution** of a task: solving a subset of its $ k $ subtasks, earning 1 point per solved subtask.
- A **complete solution** of a task: solving all $ k $ subtasks, earning $ k + 1 $ points (i.e., $ k $ for subtasks + 1 bonus).
Let $ x_i \in \{0, 1\} $ indicate whether task $ i $ is completely solved ($ x_i = 1 $) or not ($ x_i = 0 $).
Let $ s_{ij} \in \{0, 1\} $ indicate whether subtask $ j $ of task $ i $ is solved individually (only if the task is not completely solved).
**Constraints:**
- Total time used:
$$
\sum_{i=1}^n x_i \cdot \sum_{j=1}^k t_j + \sum_{i=1}^n \sum_{j=1}^k (1 - x_i) \cdot s_{ij} \cdot t_j \leq M
$$
- Each $ x_i \in \{0,1\} $, and for each $ i $, if $ x_i = 0 $, then $ s_{ij} \in \{0,1\} $; if $ x_i = 1 $, then $ s_{ij} = 0 $ for all $ j $.
**Objective:**
Maximize total points:
$$
\sum_{i=1}^n \left( x_i \cdot (k + 1) + \sum_{j=1}^k (1 - x_i) \cdot s_{ij} \right)
$$
**Alternative formulation (simpler):**
Let $ c $ be the number of completely solved tasks ($ 0 \leq c \leq n $).
Let $ T = \sum_{j=1}^k t_j $ be the time to complete one task.
Then, time spent on complete tasks: $ c \cdot T $
Remaining time: $ M - c \cdot T \geq 0 $
With remaining time, solve individual subtasks from the remaining $ n - c $ tasks.
Since subtasks are identical across tasks and order doesn't matter, we can treat all subtasks across incomplete tasks as a pool.
Let $ r = M - c \cdot T $. If $ r < 0 $, skip this $ c $.
We now want to maximize the number of subtasks solved from the $ n - c $ incomplete tasks, using time $ r $, where each subtask $ j $ costs $ t_j $, and we can solve at most $ n - c $ copies of each subtask $ j $ (one per incomplete task).
So, define a knapsack-like problem:
Let $ a_j $ be the number of times subtask $ j $ is solved across incomplete tasks ($ 0 \leq a_j \leq n - c $).
Maximize:
$$
\sum_{j=1}^k a_j
$$
subject to:
$$
\sum_{j=1}^k a_j \cdot t_j \leq r, \quad a_j \in \mathbb{Z}, \quad 0 \leq a_j \leq n - c
$$
Total points:
$$
c \cdot (k + 1) + \sum_{j=1}^k a_j
$$
**Final formal optimization problem:**
Maximize over $ c \in \{0, 1, \dots, n\} $:
$$
c \cdot (k + 1) + \max_{\substack{a_1, \dots, a_k \in \mathbb{Z} \\ 0 \leq a_j \leq n - c \\ \sum_{j=1}^k a_j t_j \leq M - c T}} \left( \sum_{j=1}^k a_j \right)
$$
Where $ T = \sum_{j=1}^k t_j $.
If $ M - c T < 0 $, then this $ c $ is infeasible.
We compute the inner max via dynamic programming over subtask types, bounded by $ n - c \leq 45 $, and total time $ M \leq 2 \cdot 10^9 $, but since $ k \leq 45 $ and $ n - c \leq 45 $, we can use DP with state $ (j, \text{time}) $, but time is too large.
**Optimization note:** Since $ n - c \leq 45 $, the total number of subtasks we can solve in incomplete tasks is at most $ 45 \cdot 45 = 2025 $. So we can instead do DP over number of subtasks solved, with minimal time to achieve $ s $ subtasks.
Let $ dp[s] = $ minimum time needed to solve exactly $ s $ subtasks across incomplete tasks (with at most $ n - c $ copies of each subtask type).
We can compute $ dp[s] $ for $ s = 0 $ to $ (n - c) \cdot k $ using bounded knapsack (or unbounded knapsack with item limits).
But since $ k \leq 45 $, $ n - c \leq 45 $, then $ s_{\max} \leq 2025 $, and we can iterate over subtask types and use DP with array size 2026.
Thus, for each $ c \in [0, n] $:
1. Compute $ r = M - c \cdot T $
2. If $ r < 0 $, skip.
3. Compute $ dp[0..S] $ where $ S = (n - c) \cdot k $, with $ dp[s] = $ minimal time to solve $ s $ subtasks from the $ k $ types, with at most $ n - c $ of each type.
4. Find $ s^* = \max \{ s \mid dp[s] \leq r \} $
5. Total points = $ c(k+1) + s^* $
Answer = $ \max_{c=0}^n \left( c(k+1) + s^* \right) $
This is the formal mathematical formulation.