Honey

Given N hives with honey amounts, a pot of capacity M, and at most K trips, maximize the total honey collected.

Medium4GreedySortingMathNo attempts yetTime limit1sMemory limit64 MB

Problem

Fluffy is a squirrel who likes honey very much. He lives on a tall, big tree and collects honey from the NN beehives on that tree.

One day he notices that every bee has gone out to work. Collecting the honey is safe now, so he decides to do it. The only thing he can carry honey in is one honey pot that holds MM ml. On each trip he picks one beehive and takes as much of the honey left in it as the pot holds, so a single trip yields the smaller of MM and the amount still in that hive. He may pick the same hive on several trips. Fluffy is a lazy squirrel, so he decides not to collect honey more than KK times.

Fluffy reads the amount of honey mim_i ml in hive ii exactly by looking at it. Compute the largest total amount of honey he can collect.

Input

The first line has three positive integers NN, MM and KK, separated by spaces. (N200,000N \le 200{,}000, K2,000,000,000K \le 2{,}000{,}000{,}000, M500,000M \le 500{,}000)

Each of the next NN lines has one positive integer mim_i. (mi500,000m_i \le 500{,}000)

Output

Print a single integer, the largest amount of honey Fluffy can collect.