#ABC478B. 配料 / Topping

配料 / Topping

Problem Statement

Takahashi is at a ramen shop.

This shop has NN kinds of toppings, and the ii-th topping has a price of ii and a happiness of WiW_i.

Takahashi chooses three distinct kinds of toppings so that the total price is at most VV. Find the maximum possible total happiness of the toppings he chooses.

The constraints guarantee that there is at least one way to choose three distinct kinds of toppings so that the total price is at most VV.

Constraints

  • 3≤N≤1003 \leq N \leq 100
  • 6≤V≤3N−36 \leq V \leq 3N-3
  • 1≤Wi≤1061 \leq W_i \leq 10^6
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

  • NN VV
  • W1W_1 W2W_2 …\ldots WNW_N

Output

Output the answer in one line.

5 9
31 41 59 26 53
143

When choosing the first, third, and fifth toppings, the total price is 1+3+5=91+3+5=9, and the total happiness is 31+59+53=14331+59+53=143.

10 16
102228 448944 131224 326172 500169 670309 976672 579051 974511 773940
2095925

When choosing the second, sixth, and seventh toppings, the total price is 2+6+7=152+6+7=15, and the total happiness is 448944+670309+976672=2095925448944+670309+976672=2095925.