#B3796. Shopping Cashback Calculation

    ID: 11453 Type: Default 1000ms 256MiB

Shopping Cashback Calculation

Shopping Cashback Calculation

Little A goes shopping in a department store with \(m\) dollars. There are \(n\) shops arranged in a line. He visits the shops in order. The product in the \(i\)-th shop costs \(a_i\) dollars.

When Little A reaches a shop, if he has enough money (i.e. his current money is at least \(a_i\)), he buys the product and his money decreases by \(a_i\). Otherwise, he skips the shop. Let \(S\) be the sum of the prices of all products he purchased.

As a premium member, he only needs to pay \(\lfloor 0.88 \times S \rfloor\) dollars. Thus, after shopping, he will receive a cashback equal to the difference between what he initially paid \(S\) and \(\lfloor 0.88 \times S \rfloor\). Your task is to calculate the cashback refund that Little A will receive.

Note: \(\lfloor x \rfloor\) denotes the floor of \(x\), i.e. the greatest integer less than or equal to \(x\).

inputFormat

The first line contains two integers \(n\) and \(m\) (\(1 \leq n \leq 10^5\), \(1 \leq m \leq 10^9\)).

The second line contains \(n\) integers \(a_1, a_2, \ldots, a_n\) where \(1 \leq a_i \leq 10^9\) representing the price of the product in the \(i\)-th shop.

outputFormat

Output a single integer, which is the cashback refund amount Little A receives.

sample

3 100
60 50 40
12