「こんぺこ、こんぺこ、こんぺこ!ホロライブ3期生の兎田ぺこらぺこ!」 Henry mimics VTuber Usada Pekora enthusiastically as she introduces herself at the beginining of a livestream.
Since the age of $ \pi^2 $, Henry has been a big fan of VTubers. Instead of stalking other children at the public park, Henry watches VTubers as his pastime. In particular, he enjoys watching Hololive VTubers the most. However, with no pocket money, he cannot send superchats to nor join the memberships of his favorite VTubers. "When I grow up, I will become a doctor so I can send many red superchats to Korone and Rushia and Gura and Fubuki and Kanata and Suisei and..."
However, Henry has become a bioinformatician instead. This means he cannot afford sending red superchats to all his favorite VTubers every day. Still, he has developed an uncontrollable habit of sending one superchat worth $ \$a_i $ for each livestream of VTuber $ i $ he watches. "I'm just paying my taxes!" Henry explains.
Hololive is a smart company. To keep its audience entertained throughout the day, $ n $ VTubers of the company are scheduled to stream one after another with no gaps in between. The $ i $-th VTuber will host the $ i $-th livestream of the day. When the $ i $-th VTuber finishes streaming, the $ (i + 1) $-th VTuber will start their livestream immediately after.
Tomorrow is Henry's payday, so he decides to use all $ \$k $ in his piggy bank to send superchats while watching VTubers today. Taking breaks between livestreams is the sign of weakness, so he will watch some number of consecutive livestreams, during each of which he will send a superchat forced by his habit. Henry wants to empty his piggy bank while watching as many consecutive livestreams as possible. Find the maximum number of consecutive livestreams he can watch using exactly $ \$k $. If there is no such number, output $ -1 $.
Input
The first line of input consists of two integers, $n$ and $k$.
The second line of input consists of $n$ integers, $a_1, a_2, \dots, a_n$.
Output
Output an integer, the answer to the problem.
Constraints
$1 \le n,k \le 10^5$
$0 \le a_i \le 10$
Sample Test Cases
Input | Output | |
---|---|---|
8 5 4 1 0 2 9 5 0 7 |
3 |
Scoring: Per Subtask
Authored by s16f22 and s17r28
Appeared in 2021 Mini Competition 0