Preparando MOJI

Book Reading

2000ms 262144K

Description:

Recently Luba bought a very interesting book. She knows that it will take t seconds to read the book. Luba wants to finish reading as fast as she can.

But she has some work to do in each of n next days. The number of seconds that Luba has to spend working during i-th day is ai. If some free time remains, she can spend it on reading.

Help Luba to determine the minimum number of day when she finishes reading.

It is guaranteed that the answer doesn't exceed n.

Remember that there are 86400 seconds in a day.

Input:

The first line contains two integers n and t (1 ≤ n ≤ 100, 1 ≤ t ≤ 106) — the number of days and the time required to read the book.

The second line contains n integers ai (0 ≤ ai ≤ 86400) — the time Luba has to spend on her work during i-th day.

Output:

Print the minimum day Luba can finish reading the book.

It is guaranteed that answer doesn't exceed n.

Sample Input:

2 2
86400 86398

Sample Output:

2

Sample Input:

2 86400
0 86400

Sample Output:

1

Informação

Codeforces

Provedor Codeforces

Código CF884A

Tags

implementation

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:20:12

Relacionados

Nada ainda