Stones Distribution

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

There is an amazingly equipped hi-tech sauna in Innopolis sport center. However, due to complex techniques were used while building it people are not sure how to maintain it properly.

There are n1n - 1 consecutive compartments in the sauna. Between each pair of adjacent compartments, there is a stove. There are two more stoves: one connected only to the first compartment, and one connected only to the last, which makes exactly nn stoves.

The ii-th compartment has volume k_ik\_i. Each stove can have from 0 to vv stones. Let p_ip\_i be the number of stones in the ii-th stove, then the ii-th compartment receives k_ip_ip_i+1k\_i \cdot p\_i \cdot p\_{i + 1} units of heat.

There are ss stove stones in sport center. Sport center management wants to minimize the sum of heat received by all compartments, so the rest of the building would not be heated up, but all stones have to be used as it is a waste to buy them otherwise. Help them solve the problem.

입력

The first line contains three integers nn, ss and vv, number of stoves, number of stones and stove capacity, respectively (2n10002 \le n \le 1000, 1v1051 \le v \le 10^5, snvs \le n \cdot v).

The second line contains n1n - 1 integers k_ik\_i, the volume of the ii-th compartment (1k_i1051 \le k\_i \le 10^5).

출력

Print the minimum possible total heat received by all compartments.

힌트

Correct answer for the sample is achieved by putting four stones in the first and the last stove and by putting two stones in the second. After that, the heat in every compartment except second is equal to zero, while the heat in the second compartment is equal to 88.