Namje Adventure

N people hang at depths 1 to N and must reach the bottom depths D-N+1 to D; only the highest person can move down 1 to L steps, find the least total energy.

Hard8Dynamic programmingGreedyMathNo attempts yetTime limit3sMemory limit512 MB

Problem

A sinkhole opened in the middle of Namjegwan. The 1333 family measured its depth from the time a stone took to hit the bottom, and they now want to explore it. They borrow a rope that Jooheon kept for a hobby and start climbing down.

Figure 1. A descent that is allowed (left) and a descent that is not allowed (right).

With a rope of length LL, a person can move down by any distance from 11 to LL. Moving down by ii costs xix_i energy. The rope is too short for safe joint descent, so only the highest person moves each time. A person cannot move into a depth that another person occupies.

Depth is the distance from the hole entrance. At the start, the NN people hang at depths 1,2,,N1, 2, \dots, N, one per depth. At the bottom, the NN people must occupy depths DN+1,DN+2,,DD-N+1, D-N+2, \dots, D, one per depth. It does not matter who stands where.

Find the minimum total energy spent until everyone reaches the bottom.

Input

The first line contains NN, DD and LL. The second line contains x1,x2,,xLx_1, x_2, \dots, x_L separated by spaces.

All values are integers with 1N31 \le N \le 3, 5L125 \le L \le 12, 2ND10102N \le D \le 10^{10} and 1xi10001 \le x_i \le 1000 for every ii.

Output

Print the minimum total energy spent until the family reaches the bottom.

Hint

Figure 1 shows the movement rule. A descent is allowed when the destination depth is empty, and it is blocked when another person occupies it.

The figure below shows two arrivals. The left side uses the minimum energy and the right side arrives with more energy.