QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 32 MB Total points: 10

#10661. Mushrooms [B]

统计

A heavy rain has come to the Bytean Forest. Byteman - an eager mushroom hunter - has decided to take his chance and go mushrooming.

Byteman knows a nice path leading through the forest which contains several glades containing a lot of mushrooms. Every two consecutive glades in the path are equidistant - Byteman needs 15 minutes to walk between any pair of adjacent glades. Having arrived at a glade, Byteman - like any other self-respecting mushroom hunter - collects all mushrooms in this glade in no time. It is a well-known fact that mushrooms... spring up like a mushroom and it takes them only half an hour to grow back after they are collected.

Knowing the numbers of mushrooms growing on respective glades, the duration of Byteman's walk and assuming that he takes a route that maximizes his crops, find the number of mushrooms he will collect. Byteman can finish his walk at any point of the path.

Input Format

The first line of the standard input contains two integers $ n $ and $ t $ (1 ≤ $ n $, $ t $ ≤ 1 000 000) which denote the number of glades in the path and the duration of Byteman's walk, in quarters. The second line contains a sequence of $ n $ integers $ a_{i} $ (1 ≤ $ a_{i} $ ≤ 1 000 000), representing the numbers of mushrooms in consecutive glades of the path. Byteman starts his walk at the first of these glades. We assume that Byteman can collect mushrooms both just before the first and just after the $ i $-th quarter of mushrooming.

Output Format

In the first and only line of the standard output your program should output one integer: the maximal number of mushrooms that can be collected by Byteman during his walk.

Example

Input

5 4
3 4 3 5 1

Output

18

Notes

In the optimal Byteman's route, which takes him 60 minutes, he collects 18 mushrooms: 3 at time 0, 4 after 15 minutes, 3 after 30 minutes, 5 after 45 minutes and, finally, 3 after 60 minutes.

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.