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 a_{i}. 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 ≤ 10^6) — the number of days and the time required to read the book.

The second line contains n integers a_{i} (0 ≤ a_{i} ≤ 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.


-----Examples-----
Input
2 2
86400 86398

Output
2

Input
2 86400
0 86400

Output
1

Difficulty: EASY

Solutions:
(n, t) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < n:
	t -= 86400 - a[i]
	if t <= 0:
		break
	i += 1
print(i + 1)


(n, t) = map(int, input().split())
a = [int(i) for i in input().split()]
for i in range(n):
	t -= 86400 - a[i]
	if t <= 0:
		print(i + 1)
		break


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(len(l)):
	t -= 86400 - l[i]
	if t <= 0:
		print(i + 1)
		break


a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
t = 0
for i in range(0, a[0]):
	s += 86400 - b[i]
	t += 1
	if s >= a[1]:
		break
print(t)


s = input().split()
n = int(s[0])
t = int(s[1])
s = input().split()
summ = 0
k = n
key = 0
for i in s:
	key += 1
	summ += 86400 - int(i)
	if summ >= t:
		print(key)
		quit()


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
d = 0
while t > 0:
	t -= 86400 - A[d]
	d += 1
print(d)


(n, t) = list(map(int, input().split()))
data = list(map(int, input().split()))
s = 0
new = []
for i in data:
	s += 86400 - i
	new.append(s)
for i in range(n):
	if new[i] >= t:
		print(i + 1)
		break
else:
	print(n)


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
while t > 0:
	a = 86400 - l[i]
	t = t - a
	i = i + 1
print(i)


n = input()
(a, b) = n.split()
b = int(b)
c = input()
c = c.split()
list = []
for q in c:
	q = int(q)
	list.append(q)
sum = 0
ans = 0
for a in range(0, len(list)):
	sum += 86400 - list[a]
	if sum >= b:
		ans = a + 1
		break
print(ans)


(n, t) = map(int, input().split())
l = [int(x) for x in input().split()]
d = 86400
count = 0
dif = 0
for i in l:
	dif += d - i
	count += 1
	if t <= dif:
		print(count)
		break


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n):
	s += 86400 - l[i]
	if s >= k:
		print(i + 1)
		break


q = input()
b = 0
y = 0
i = 0
w = q.split()
n = int(w[0])
t = int(w[1])
q = input()
a = q.split()
while y == 0:
	a[i] = 86400 - int(a[i])
	b = b + a[i]
	if t <= b:
		print(i + 1)
		y = 1
	i = i + 1


s1 = input()
w = s1.split()
n = int(w[0])
t = int(w[1])
s2 = input()
s2 = s2.split()
x = []
for i in range(n):
	x.append(int(s2[i]))
t0 = 0
d = 1
for i in x:
	if t0 >= t:
		break
	if i <= 86400:
		t0 += 86400 - i
	if t0 >= t:
		break
	d += 1
print(d)


Time = input().split()
Work = input().split()
days = int(Time[0])
reading = int(Time[1])
i = 0
while reading > 0:
	reading -= 86400 - int(Work[i])
	i += 1
	if i == len(Work):
		break
print(i)


TN = 1

def solution():
	(n, t) = map(int, input().split())
	a = list(map(int, input().split()))
	cur = t
	for i in range(n):
		cur -= 86400 - a[i]
		if cur <= 0:
			print(i + 1)
			break
while TN != 0:
	solution()
	TN -= 1


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
	t += a[i] - 86400
	if t <= 0:
		print(i + 1)
		exit()


class Solver:

	def run(self):
		(n, t) = map(int, input().split())
		a = list(map(int, input().split()))
		k = 0
		for i in range(n):
			k += 86400 - a[i]
			if k >= t:
				print(i + 1)
				break
Solver().run()


(a, b) = map(int, input().split())
z = list(map(int, input().split()))
x = 0
for i in range(len(z)):
	x += 86400 - z[i]
	if x >= b:
		print(i + 1)
		break


def reading(lst, t):
	(result, count) = (0, t)
	for i in range(len(lst)):
		if count == 0:
			break
		d = min(86400 - lst[i], count)
		count -= d
		result += 1
	return result
(n, t) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
print(reading(a, t))


(n, t) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 1
sums = []
for i in a:
	sums.append(86400 - i)
while sum(sums[0:ans]) < t:
	ans += 1
print(ans)


(n, t) = map(int, input().split())
timePerDay = list(map(int, input().split()))
res = 0
for i in range(n):
	if 86400 + res - timePerDay[i] >= t:
		print(i + 1)
		break
	else:
		res += 86400 - timePerDay[i]


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(n):
	c = 86400 - l[i]
	if c == 0:
		continue
	elif c >= t:
		print(i + 1)
		break
	else:
		t -= c


line = list(map(int, input().split()))
(days, time) = line
secList = list(map(int, input().split()))
for i in range(len(secList)):
	secList[i] = 86400 - secList[i]
reqDays = 0
for i in range(len(secList)):
	time -= secList[i]
	reqDays += 1
	if time <= 0:
		break
print(reqDays)


SECONDS_IN_DAY = 86400
(n, t) = map(int, input().split())
a = list(map(int, input().split()))
ans = -1
for i in range(len(a)):
	if t > 0:
		t = t - (SECONDS_IN_DAY - a[i])
		ans = i if t <= 0 else -1
print(ans + 1)


(n, t) = list(map(int, input().split()))
N = list(map(int, input().split()))
counter = 0
i = 0
while counter < t:
	counter += 86400 - N[i]
	i += 1
print(i)


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
B = []
for i in range(n):
	B.append(86400 - A[i])
su = 0
for i in range(n):
	su += B[i]
	if su >= t:
		print(i + 1)
		break


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for (i, j) in enumerate(a):
	t = t - (86400 - j)
	if t <= 0:
		print(i + 1)
		break


(n, k) = [int(i) for i in input().split()]
lst = [int(i) for i in input().split()]
s = 86400
nd = 1
for i in lst:
	d = s - i
	k = k - d
	if k <= 0:
		print(nd)
		break
	nd += 1


input1 = input().split()
days = input1[0]
time = int(input1[1])
total_input = 0
time_left = 0
day = 0
answer = input().split()
while total_input < int(days):
	time_left = 86400 - int(answer[total_input])
	time = time - time_left
	day = day + 1
	if time <= 0:
		break
	total_input += 1
print(day)


(n, t) = map(int, input().split())
count = 0
p = 86400
a = list(map(int, input().split()))
for i in a:
	count += 1
	if i < p:
		z = p - i
		if z == t or t - z < 0:
			break
		else:
			t = t - z
print(count)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, m) = invr()
li = inlt()
tot = 0
cnt = 0
while tot < m:
	tot += 86400 - li[cnt]
	cnt = cnt + 1
print(cnt)


a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = a[1]
d = a[0]
e = 0
for i in range(0, d):
	c = c - (86400 - b[i])
	if c <= 0:
		print(i + 1)
		break


(n, t) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
count = 0
for i in range(0, n):
	count += 86400 - l[i]
	if count >= t:
		break
print(i + 1)


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(len(l)):
	left = 86400 - l[i]
	if left >= k:
		print(i + 1)
		break
	else:
		k = k - left


(n, t) = map(int, input().split())
work = list(map(int, input().split()))
d = 1
for i in work:
	if 86400 - i < t:
		t -= 86400 - i
		d += 1
	else:
		break
print(d)


def reversed_list(l, start, end):
	if start >= end:
		return l
	(l[start], l[end]) = (l[end], l[start])
	return reversed_list(l, start + 1, end - 1)

def main_function():
	(n, t) = [int(i) for i in input().split(' ')]
	l = [86400 - int(i) for i in input().split(' ')]
	sum = 0
	for i in range(len(l)):
		sum += l[i]
		if sum >= t:
			return i + 1
print(main_function())


(n, t) = map(int, input().split())
li = list(map(int, input().split()))
sumsec = 0
count = 0
for i in li:
	if sumsec >= t:
		break
	sumsec += 86400 - i
	count += 1
print(count)


i = lambda : map(int, input().split())
(_, d) = i()
r = 0
for x in i():
	r += 1
	d -= 86400 - x
	if d < 1:
		break
print(r)


func = lambda x: int(x)
l1 = list(map(func, input().split()))
n = l1[0]
t = l1[1]
l2 = list(map(func, input().split()))
accumulator = 0
for i in range(n):
	time = 86400 - l2[i]
	accumulator = accumulator + time
	if accumulator >= t:
		print(i + 1)
		break


DAY = 86400
(n, k) = map(int, input().split())
x = map(int, input().split())
day = 1
for i in x:
	k -= DAY - i
	if k <= 0:
		break
	day += 1
print(day)


(n, m) = map(int, input().split())
c = list(map(int, input().split()))
l = 0
while m > 0:
	m -= 86400 - c[l]
	l += 1
print(l)


(n, t) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
s = 0
d = 0
for i in a:
	t = t - (86400 - i)
	d += 1
	if t <= 0:
		break
print(d)


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
a = 86400
for i in range(n):
	rem = a - A[i]
	t -= min(t, rem)
	if t == 0:
		ans = i + 1
		break
if t == 0:
	print(ans)
else:
	ans += t / a
	if t % a:
		ans += 1
	print(ans)


(n, t) = map(int, input().split())
days = map(int, input().split())
ans = 1
for i in days:
	if t <= 86400 - i:
		print(ans)
		break
	else:
		t -= 86400 - i
		ans += 1


(n, t) = [int(i) for i in input().split(' ')]
A = [int(i) for i in input().split(' ')]
i = 0
while t > 0 and i < n:
	t -= 86400 - A[i]
	i += 1
print(i)


import sys
import math
import bisect
import itertools

def main():
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	for i in range(n):
		A[i] = 86400 - A[i]
	for i in range(n):
		if sum(A[:i + 1]) >= m:
			print(i + 1)
			break
main()


n = [int(i) for i in input().split()]
f = [int(i) for i in input().split()]
t = n[1]
j = 0
for i in range(n[0]):
	s = 86400 - f[i]
	if t > 0:
		t = t - s
		j = j + 1
print(j)


alph = 'abcdefghijklmnopqrstuvwxyz'
(n, t) = map(int, input().split())
z = list(map(int, input().split()))
for i in range(n):
	t -= 86400 - z[i]
	if t <= 0:
		print(i + 1)
		break


(n, t) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()][:n]
count = 0
time = 0
flag = 0
for i in range(n):
	count += 86400 - a[i]
	time += 1
	if count >= t:
		print(time)
		flag = 1
		break
if flag == 0:
	print(time)


data1 = list(map(int, input().split()))
data2 = list(map(int, input().split()))
daySeconds = 86400
day = 0
while data1[1] > 0:
	freetime = daySeconds - data2[day]
	data1[1] -= freetime
	day += 1
print(day)


(n, t) = list(map(int, input().split()))
a = list(map(int, input().split()))
secondInDay = 24 * 60 * 60
result = 0
while t > 0:
	t -= secondInDay - a[result]
	result += 1
print(result)


R = lambda : list(map(int, input().split()))
(n, m) = R()
l = R()
(c, i) = (m, 0)
while c > 0:
	c -= 86400 - l[i]
	i += 1
print(i)


(n, t) = map(lambda x: int(x), str(input()).split(' '))
a = list(map(lambda x: int(x), str(input()).split(' ')))
day = 0
while t > 0:
	t -= 86400 - a[day]
	day += 1
print(day)


def r():
	(n, t) = list(map(int, input().split()))
	work = list(map(int, input().split()))
	for i in range(n):
		t -= 86400 - work[i]
		if t <= 0:
			return i + 1
print(r())


s = input().rstrip().split(' ')
p = input().rstrip().split(' ')
t = int(s[1])
Y = 0
f = 0
for i in range(0, len(p)):
	f = f + 86400 - int(p[i])
	Y += 1
	if f >= t:
		break
print(Y)


(n, t) = map(int, input().split())
s = list(map(int, input().split()))
i = 0
for day in range(n):
	i += 86400 - s[day]
	if i >= t:
		print(day + 1)
		break


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
for q in range(n):
	t = t - (86400 - A[q])
	if t <= 0:
		print(q + 1)
		break


DAY = 86400
(n, t) = map(int, input().split())
a = list(reversed(list(map(int, input().split()))))
cnt = 0
while t > 0:
	t -= DAY - a.pop()
	cnt += 1
print(cnt)


from itertools import accumulate
(n, t) = [int(x) for x in input().split()]
a = [86400 - int(x) for x in input().split()]
for (i, acc) in enumerate(accumulate(a)):
	if acc >= t:
		print(i + 1)
		break


(n, t) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
for i in range(len(a)):
	t -= 86400 - a[i]
	if t <= 0:
		break
print(i + 1)


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
i = 0
ans = 0
while t > 0 and ans <= n:
	ans += 1
	a = 86400 - l[i]
	t -= a
	i += 1
if ans <= n:
	print(ans)
else:
	print(n)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
x = 0
ans = 0
for i in range(0, n):
	x += abs(a[i] - 86400)
	ans += 1
	if x >= m:
		break
print(ans)


(n, t) = map(int, input().split(' '))
ans = -1
L = [int(x) for x in input().split()]
for i in range(n):
	t -= 86400 - L[i]
	if ans == -1 and t <= 0:
		ans = i + 1
print(ans)


(a, b) = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]
summ = 0
for i in range(0, a):
	summ += 86400 - c[i]
	if summ >= b:
		print(i + 1)
		break


(n, t) = map(int, input().split())
x = list(map(int, input().split()))
for i in range(n):
	t -= 86400 - x[i]
	if t < 1:
		print(i + 1)
		exit()


(n, t) = map(int, input().split())
d = []
for x in input().split():
	d.append(int(x))
k = 0
tp = 0
for i in range(n):
	k += 1
	tp += 86400 - d[i]
	if tp >= t:
		break
print(k)


import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
from functools import lru_cache
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
(n, k) = mapi()
a = list(mapi())
res = 0
for i in range(n):
	k -= 86400 - a[i]
	res += 1
	if k <= 0:
		break
print(res)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
x = 0
c = 0
while x < t:
	x += 86400 - a[c]
	c += 1
print(c)


fullday = 86400
(n, t) = list(map(int, input().split()))
days = list(map(int, input().split()))
total = 0
for day in range(n):
	total += fullday - days[day]
	if total >= t:
		print(day + 1)
		break


(n, x) = map(int, input().split())
li = list(map(int, input().split()))
ans = 0
day = 0
for i in li:
	day += 1
	ans += 86400 - i
	if ans >= x:
		break
print(day)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(len(a)):
	t -= 60 * 60 * 24 - a[i]
	if t <= 0:
		print(i + 1)
		exit()


(n, t) = list(map(int, input().split(' ')))
taba = list(map(int, input().split(' ')))
timeleft = t
day = 0
while timeleft > 0:
	timeleft -= 86400 - taba[day]
	day += 1
print(day)


def mi():
	return map(int, input().split())
(n, t) = mi()
a = list(mi())
s = 0
i = 0
while i < n:
	t -= 86400 - a[i]
	if t <= 0:
		print(i + 1)
		break
	i += 1


(_, t) = map(int, input().split())
result = 0
for (index, value) in enumerate(map(int, input().split())):
	t -= 86400 - value
	if t <= 0:
		result = index + 1
		break
print(result)


(d, t) = map(int, input().split())
time = list(map(int, input().split()))
counter = 0
for i in time:
	rest = 86400 - i
	t -= rest
	counter += 1
	if t <= 0:
		print(counter)
		break


def solve(n, t, a):
	s = 0
	for (d, i) in enumerate(a):
		s += 86400 - i
		if s >= t:
			return d + 1

def main():
	(n, t) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve(n, t, a))
main()


(n, t) = tuple(map(int, input().split()))
a = [int(x) for x in input().split()]
(c, k) = (0, 0)
for i in a:
	c += 86400 - i
	k += 1
	if c >= t:
		break
print(k)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
s = 0
q = 0
for i in a:
	s += 86400 - i
	q += 1
	if s >= t:
		print(q)
		break


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
l = []
for i in range(n):
	l.append(86400 - a[i])
	if sum(l) >= t:
		print(i + 1)
		break


(days, t) = map(int, input().split())
a = list(map(int, input().split()))
day = 86400
p = 0
for i in range(days):
	d = day - a[i]
	if t:
		p += 1
		if d >= t:
			break
		else:
			t -= d
print(p)


(n, t) = map(int, input().split())
days = [int(i) for i in input().split()]
limit = 0
count = 0
for i in days:
	if limit >= t:
		break
	limit += 86400 - i
	count += 1
print(count)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
p = 0
k = 0
for i in range(len(a)):
	if k < m:
		k = k + abs(a[i] - 86400)
		p += 1
	else:
		break
print(p)


(n, t) = list(map(int, input().split()))
number = list(map(int, input().split()))
c = 0
flag = 0
for i in range(n):
	if t <= 0:
		flag = 1
		print(c)
		break
	else:
		t -= 86400 - number[i]
		c = c + 1
if flag == 0:
	print(c)


baris = input()
string = baris.split(' ')
n = int(string[0])
t = int(string[1])
baris = input()
string = baris.split(' ')
a = []
for i in range(0, n):
	a.append(int(string[i]))
for i in range(0, n):
	t = t - (86400 - a[i])
	if t <= 0:
		break
print(i + 1)


a = int(input().split()[1])
s = 0
for i in map(int, input().split()):
	a -= 86400 - i
	s += 1
	if a <= 0:
		print(s)
		exit()


(n, t) = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
for i in range(n):
	if 86400 - q[i] >= t:
		print(i + 1)
		break
	else:
		t -= 86400 - q[i]


(n, x) = map(int, input().split())
a = [int(x) for x in input().split()]
ans = 0
while x > 0:
	x -= 86400 - a[ans]
	ans += 1
print(ans)


days_bookstime = list(map(int, input().split()))
time_of_work = list(map(int, input().split()))
for i in range(days_bookstime[0]):
	days_bookstime[1] -= 86400 - time_of_work[i]
	if days_bookstime[1] <= 0:
		print(i + 1)
		break


(n, t) = [int(z) for z in input().split()]
a = [86400 - int(z) for z in input().split()]
cnt = 0
i = 0
while cnt < t:
	cnt += a[i]
	i += 1
print(i)


import math
(n, t) = map(int, input().split())
arr = list(map(int, input().split()))

def summArr(arr):
	ans = 0
	for i in arr:
		ans += i
	return ans

def main():
	count_seconds = 86400
	ans = 0
	sub = t
	for i in arr:
		tmp = count_seconds - i
		sub -= tmp
		if sub <= 0:
			ans += 1
			break
		ans += 1
	print(ans)
main()


(n, t) = list(map(int, input().split()))
a = list(map(int, input().split()))
k = 0
s = 86400 - a[0]
while s < t:
	k += 1
	s += 86400 - a[k]
print(k + 1)


(a, t) = input().split()
t = int(t)
b = [abs(86400 - int(x)) for x in input().split()]
c = 0
s = 0
i = 0
while s < t:
	s = s + b[i]
	i = i + 1
	c = c + 1
print(c)


I = lambda : map(int, input().split())
(_, t) = I()
s = 0
for (i, a) in enumerate(I(), 1):
	s += 86400 - a
	if s >= t:
		print(i)
		break


x = input().split()
y = input().split()
a = int(x[0])
b = int(x[1])
c = 0
for i in y:
	i = int(i)
	b = b - (86400 - i)
	c = c + 1
	if b <= 0:
		print(c)
		break


import sys
(n, t) = map(int, input().split())
l = list(map(int, input().split()))
sum = 0
for i in range(n):
	sum += 86400 - l[i]
	if sum >= t:
		print(i + 1)
		sys.exit()


def f(t, arr):
	mtime = 86400
	r = 1
	for x in arr:
		t -= mtime - x
		if t <= 0:
			break
		r += 1
	print(r)

def __starting_point():
	(n, t) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	f(t, arr)
__starting_point()


x = input()
y = input()
x = x.split()
n = int(x[0])
t = int(x[1])
y = y.split()
d = []
for i in y:
	d.append(86400 - int(i))
flag = 0
for i in range(n):
	if d[i] < t:
		t = t - d[i]
	else:
		flag = i + 1
		break
print(flag)


(n, t) = map(int, input().split())
s = list(map(int, input().split()))
k = 0
for i in s:
	t -= 86400 - i
	k += 1
	if not max(t, 0):
		break
print(k)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
(N, T) = map(int, input().split())
A = [int(x) for x in input().split()]
for i in range(N):
	T -= 86400 - A[i]
	if T <= 0:
		print(i + 1)
		exit(0)
print(N)


X = list(map(int, input().split()))
Days = list(map(int, input().split()))
Sum = 0
for i in range(len(Days)):
	Sum += 86400 - Days[i]
	if Sum >= X[1]:
		print(i + 1)
		exit()


n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
c = 0
i = 0
t = 0
while t < n[1]:
	t += 86400 - a[i]
	c += 1
	i += 1
print(c)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
b = [86400 - a[i] for i in range(len(a))]
m = 0
for i in range(len(b)):
	m += b[i]
	if m >= t:
		print(i + 1)
		break


a = input()
a = a.split()
a = list(map(int, a))
t = a[1]
b = input()
b = b.split()
b = list(map(int, b))
c = list(map(lambda b: 86400 - b, b))
flag = 0
k = 0
i = 0
while k == 0:
	flag += c[i]
	i += 1
	if flag >= t:
		print(i)
		k = 1


(x, y) = map(int, input().split(' '))
arr = [86400 for i in range(x)]
A = list(map(int, input().split()))
for i in range(len(arr)):
	arr[i] = arr[i] - A[i]
for i in range(len(arr)):
	if y > arr[i]:
		y -= arr[i]
	else:
		print(i + 1)
		break


(n, t) = map(int, input().split())
lis = list(map(int, input().split()))
(seconds, cnt) = (86400, 0)
for x in lis:
	if t <= 0:
		break
	t -= seconds - x
	cnt += 1
print(cnt)


inp = list(map(int, input().split()))
n = inp[0]
t = inp[1]
time = list(map(int, input().split()))
count = 0
sum = 0
for x in range(n):
	if sum >= t:
		break
	else:
		sum += 86400 - time[x]
		count += 1
print(count)


from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)
	print(l)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans
(n, t) = mi()
l = li()
count = 0
x = 0
for i in l:
	x += 86400 - i
	count += 1
	if x >= t:
		print(count)
		break


R = lambda : map(int, input().split())
(n, t) = R()
for (i, x) in enumerate(R(), 1):
	t -= 86400 - x
	if t <= 0:
		break
print(i)


(n, t) = [int(i) for i in input().split()]
work = [int(i) for i in input().split()]
sum = 0
day = 0
while sum < t:
	day += 1
	sum += 86400 - work[day - 1]
print(day)


(n, t) = map(int, input().split())
n = 0
s = list(map(lambda x: 86400 - int(x), input().split()))
for (i, j) in enumerate(s):
	n += j
	if n >= t:
		print(i + 1)
		exit(0)


(n, t) = [int(x) for x in input().split()]
a = [86400 - int(x) for x in input().split()]
s = 0
for (i, x) in enumerate(a):
	s += x
	if s >= t:
		print(i + 1)
		break


def min_day(nday, r_time, arr):
	for i in range(len(arr)):
		arr[i] = 86400 - arr[i]
	total = 0
	i = 0
	while total < r_time and i <= nday:
		total += arr[i]
		i += 1
	return i
(n_day, time) = map(int, input().split())
array = list(map(int, input().split()))
print(min_day(n_day, time, array))


(N, T) = map(int, input().split(' '))
L = list(map(int, input().split(' ')))
S = 86400
S1 = 0
for i in range(0, N):
	W = S - L[i]
	if W >= T:
		T = T - W
		S1 = S1 + 1
		break
	else:
		S1 = S1 + 1
		T = T - W
print(S1)


f = lambda : map(int, input().split())
(n, t) = f()
s = 0
l = [86400 - i for i in list(f())]
for i in range(n):
	s += l[i]
	if s >= t:
		print(i + 1)
		break


from itertools import permutations
(m, n) = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for i in range(m):
	sum += 86400 - a[i]
	if sum >= n:
		print(i + 1)
		break


f = input()
fn = f.split(' ')
t = int(fn[1])
works = [i for i in input().split(' ')]
time = 0
for i in range(int(fn[0])):
	work = int(works[i])
	if i == 0:
		free = abs(work - 86400)
		day = t - free
		time += 1
	elif i > 0:
		free = abs(work - 86400)
		day -= free
		time += 1
	if day == 0 or day < 0:
		print(time)
		break


(n, t) = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
cnt = 0
for x in arr:
	if 86400 - x >= 0:
		t -= 86400 - x
		cnt += 1
	if t <= 0:
		break
print(cnt)


def main():
	(n, t) = map(int, input().split())
	for (i, x) in enumerate(map(int, input().split()), 1):
		t -= 86400 - x
		if t <= 0:
			break
	print(i)
main()


import sys
(n, t) = map(int, input().split())
a = [86400 - x for x in map(int, input().split())]
for (i, x) in enumerate(a, start=1):
	t -= x
	if t <= 0:
		print(i)
		break


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
	t -= 86400 - a[i]
	if t <= 0:
		print(i + 1)
		exit()


n = list(map(int, input().split(' ')))
re = n[1]
S = list(map(int, input().split(' ')))
for i in range(len(S)):
	re = re - (86400 - S[i])
	if re <= 0:
		print(i + 1)
		break


(n, s) = map(int, input().split())
l = list(map(int, input().split()))
count = 0
for i in l:
	count += 1
	c = 86400 - i
	s = s - c
	if s <= 0:
		break
print(count)


(n, time) = map(int, input().split())
times = map(int, input().split())
day = 0
for t in times:
	work_time = t
	if time > 0:
		day += 1
		left_out_time = 86400 - work_time
		time -= left_out_time
print(day)


inp = input()
(n, t) = inp.split()
n = int(n)
t = int(t)
inp2 = input()
inp2 = inp2.split()
for i in range(n):
	inp2[i] = int(inp2[i])
time = 86400
for i in range(n):
	if t - time + inp2[i] <= 0:
		print(i + 1)
		break
	t = t - time + inp2[i]


(n, m) = input().split()
(n, m) = [int(n), int(m)]
work_time = [int(x) for x in input().split()]
for i in range(n):
	m -= 86400 - work_time[i]
	if m <= 0:
		print(i + 1)
		break


(n, t) = map(int, input().split())
ls = list(map(int, input().split()))
i = 0
sum1 = 0
while i < n:
	sum1 += 86400 - ls[i]
	if sum1 >= t:
		print(i + 1)
		exit()
	i += 1


(a, b) = map(int, input().split())
c = list(map(int, input().split()))
cnt = 0
for i in c:
	d = 86400 - int(i)
	b = b - d
	cnt += 1
	if b <= 0:
		break
print(cnt)


input1 = input()
(n, m) = map(int, input1.split(' '))
input2 = input()
input2 = [int(i) for i in input2.split(' ')]
time_reading = 0
i = 0
while time_reading < m and i + 1 <= n:
	time_reading += 24 * 60 * 60 - input2[i]
	i += 1
print(i)


import sys
import math
FNAME = 'A'
(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
	t -= 86400 - a[i]
	if t <= 0:
		print(i + 1)
		break


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, k) = invr()
ara = inara()
i = 0
while k > 0:
	k -= 86400 - ara[i]
	i += 1
print(i)


(n, t) = [int(a) for a in input().split()]
vt = list()
vt = [int(x) for x in input().split()]
time = 0
count = 0
for i in vt:
	time = time + 86400 - i
	if time >= t:
		count = count + 1
		print(count)
		exit()
	else:
		count = count + 1


(a, b) = input().split()
values = [int(x) for x in input().split()]
a = int(a)
b = int(b)
dni = 0
for i in range(a):
	dni += 1
	cas = 86400 - values[i]
	b = b - cas
	if b <= 0:
		break
print(dni)


(n, t) = map(int, input().split())
arr = map(int, input().split())
ans = 0
for i in arr:
	t -= 86400 - i
	ans += 1
	if t <= 0:
		break
print(ans)


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
ll = [86400 - i for i in l]
c = 0
for i in ll:
	if t > 0:
		t -= i
		c += 1
	else:
		break
print(c)


(n, t) = map(int, input().split())
m = list(map(int, input().split()))
x = 0
for i in range(n):
	x += 86400 - m[i]
	if x >= t:
		print(i + 1)
		break


seconds_in_day = 86400
(n, t) = input().split()
n = int(n)
t = int(t)
string_seconds = input().split()
int_seconds = list(map(int, string_seconds))
sum = 0
day = 1
for i in range(n):
	sum += seconds_in_day - int_seconds[i]
	if sum >= t:
		break
	day += 1
print(day)


import itertools
ct = 0
(n, t) = map(int, input().split())
a = [86400 - x for x in [int(x) for x in input().split()]]
for x in itertools.accumulate(a):
	ct += 1
	if x >= t:
		res = ct
		break
print(res)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
count = 0
progress = 0
while progress < t:
	count += 1
	progress += 60 * 60 * 24 - a[count - 1]
print(count)


(num_of_days, time_reading) = input().split(' ')
times = input().split(' ')
n = 0
s = int(time_reading)
for i in range(len(times)):
	if int(times[i]) + int(s) <= 86400:
		print(i + 1)
		n += 1
		break
	elif 86400 - int(times[i]) > 0:
		s -= 86400 - int(times[i])
	else:
		continue
if n == 0:
	print(0)


r = lambda : map(int, input().split())

def main():
	(n, t) = r()
	a = list(r())
	for (i, x) in enumerate(a):
		t -= 86400 - x
		if t <= 0:
			print(i + 1)
			return
main()


(n, t) = map(int, input().split())
li = list(map(int, input().split()))
second = 86400
days = 0
for i in range(n):
	rest = second - li[i]
	t = t - rest
	days = days + 1
	if t <= 0:
		break
print(days)


import itertools

def main():
	(n, t) = [int(v) for v in input().split()]
	d = [int(v) for v in input().split()]
	s = 0
	for (i, v) in enumerate(d):
		s += 86400 - v
		if s >= t:
			print(i + 1)
			return
main()


L = 86400
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
for (d, i) in enumerate(a, 1):
	k -= L - i
	if k <= 0:
		print(d)
		exit()
print(n + 1)


l = input().split(' ')
(n, t) = (int(l[0]), int(l[1]))
d = list(map(int, input().split(' ')))
length = len(d)
days = 0
ti = 0
for i in range(length):
	ti += 86400 - d[i]
	days += 1
	if ti >= t:
		break
if ti >= t:
	print(days)
else:
	print(n)


(n, t) = map(int, input().split())
d = 0
l = list(map(int, input().split()))
for el in l:
	if t <= 0:
		break
	t -= 86400 - el
	d += 1
print(d)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
i = 0
while i < n:
	ans += 86400 - a[i]
	if ans >= t:
		print(i + 1)
		exit()
	i += 1


s_in = str(input()).split()
n = int(s_in[0])
t = int(s_in[1])
s_in = str(input()).split()
s = 0
for i in range(0, n):
	s += 86400 - int(s_in[i])
	if s >= t:
		print(i + 1)
		quit()


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
d = 0
for time in a:
	d += 1
	t -= 86400 - time
	if t <= 0:
		break
if t <= 0:
	print(d)
else:
	print(d + 1)


(n, t) = map(int, input().split())
s = list(map(int, input().split()))
ans = 0
flag = False
for i in range(len(s)):
	t -= 86400 - s[i]
	if t <= 0:
		ans = i + 1
		break
print(ans)


(n, t) = list(map(int, input().split()))
m = list(map(int, input().split()))
f = 0
c = 0
for i in range(n):
	if m[i] < 86400:
		d = 86400
		d = d - m[i]
		f = f + d
		c += 1
		if f >= t:
			print(c)
			break
	else:
		c += 1
		if f >= t:
			print(c)
			break


(a, b) = map(int, input().split())
work = list(map(int, input().split()))
count = 0
for i in range(a):
	count += 86400 - work[i]
	if count >= b:
		break
print(i + 1)


(n, t) = map(int, input().split())
tmp = input()
jumlah = 0
ans = 0
for i in map(int, tmp.split()):
	x = 86400 - i
	jumlah += x
	ans += 1
	if jumlah >= t:
		print(ans)
		break


def func():
	(n, t) = [int(n) for n in input().split()]
	times = [int(n) for n in input().split()]
	ans = 0
	for i in times:
		if t <= 0:
			break
		else:
			t -= 86400 - i
			ans += 1
	print(ans)
func()


(n, m) = [int(x) for x in input().strip().split()]
l = [int(x) for x in input().strip().split()]
day = 0
for k in l:
	day = day + 1
	m = m - (86400 - k)
	if m <= 0:
		break
print(day)


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	(n, t) = read_ints()
	A = [86400 - x for x in read_ints()]
	total = 0
	for (i, a) in enumerate(A):
		total += a
		if total >= t:
			print(i + 1)
			return

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


s = input()
(n, m) = s.split(' ')
t = input()
x = t.split(' ')
sum = 0
for (i, j) in enumerate(x):
	sum = sum + (86400 - int(j))
	if sum >= int(m):
		print(int(i) + 1)
		exit(0)


k = 0
m = input().split()
n = int(m[0])
t = int(m[1])
i = 0
a = input().split()
for i in range(0, n):
	k = k + 86400 - int(a[i])
	if k >= t:
		print(i + 1)
		break


(n, t) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]
ans = 0
while t > 0:
	t -= 86400 - a[ans]
	ans += 1
print(ans)


n = list(map(int, input().split()))
k = list(map(int, input().split()))
t = n[1]
p = 0
for i in k:
	if 86400 - i < t:
		t = t - (86400 - i)
		p += 1
	else:
		p += 1
		break
print(p)


(n, t) = list(map(int, input().split()))
u = 86400
s = list(map(int, input().split()))
p = 0
for i in range(len(s)):
	p += abs(u - s[i])
	if p >= t:
		print(i + 1)
		break


(n, t) = map(int, input().split())
a = [int(i) for i in input().split()]
new_a = []
for i in a:
	new_a.append(86400 - i)
i = 1
x = new_a[0]
while x < t:
	x += new_a[i]
	i += 1
print(i)


line = input().split()
n = int(line[0])
t = int(line[1])
line = input().split()
for i in range(n):
	t = t - 86400 + int(line[i])
	if t < 1:
		break
print(i + 1)


import math
(n, t) = [int(x) for x in input().split(' ')]
l = [int(x) for x in input().split(' ')]
z = 1
for x in l:
	q = 86400 - x
	if q == 0:
		z += 1
	else:
		t -= q
		if t <= 0:
			break
		else:
			z += 1
print(z)


(n, m) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n + 1):
	if m > 0:
		m = m - 86400 + a[i]
	else:
		break
print(i)


def useful_time(x):
	return 86400 - int(x)
tn = list(map(int, input().split(' ')))
seconds = list(map(useful_time, input().split(' ')))
i = 0
while tn[1] > 0:
	tn[1] -= seconds[i]
	i += 1
print(i)


(n, t) = map(int, input().split())
arr = list(map(int, input().split()))
c = 0
for i in arr:
	t -= 86400 - i
	c += 1
	if t <= 0:
		break
print(c)


(n, t) = list(map(int, input().split()))
worktimes = list(map(int, input().split()))
cnt = 0
for i in worktimes:
	t = t - (86400 - i)
	cnt += 1
	if t <= 0:
		print(cnt)
		break


(a, b) = map(int, input().split())
s = list(map(int, input().split()))
i = 0
x = 0
while x < b:
	x += 86400 - s[i]
	i += 1
print(i)


(t, m) = map(int, input().split())
arr = list(map(int, input().split()))
count_ = 0
for i in arr:
	temp = 86400 - i
	if m == 0:
		break
	else:
		m -= temp
		count_ += 1
		if m <= 0:
			m = 0
		else:
			continue
print(count_)


(n, t) = map(int, input().split())
s = 0
d = 0
a = list(map(int, input().split()))
for i in range(0, n):
	if s < t:
		s += 86400 - a[i]
		d += 1
	else:
		break
if s >= t:
	print(d)


(a, b) = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
t = 0
m = 0
for i in range(a):
	z = 86400 - c[i]
	m += z
	if m >= b:
		t += 1
		break
	t += 1
print(t)


(n, t) = input().split()
working_time = [int(x) for x in input().split()]
count = 0
remain_time = int(t)
for seconds in working_time:
	free_time = 86400 - seconds
	remain_time = remain_time - free_time
	count += 1
	if remain_time <= 0:
		break
	else:
		continue
print(count)


n = input().split()
n[0] = int(n[0])
n[1] = int(n[1])
li = list(map(int, input().split()))
c = 1
x = 0
while n[1] > 0:
	if li[x] < 86400:
		n[1] -= 86400 - li[x]
		if n[1] > 0:
			x += 1
			c += 1
	else:
		c += 1
		x += 1
print(c)


(n, t) = map(int, input().split())
work = list(map(int, input().split()))
found = False
minday = n
b = t
for i in range(n):
	for j in range(i, n):
		b += work[j] - 86400
		if b <= 0:
			print(j + 1)
			found = True
			break
	b = t
	if found:
		break
else:
	print(n)


def find_min_num_of_days(time_to_read, work_times):
	curr = days = 0
	for time in work_times:
		curr += 86400 - time
		days += 1
		if curr >= time_to_read:
			break
	return days
(n, t) = map(int, input().split())
print(find_min_num_of_days(t, list(map(int, input().split()))))


import re
import sys
import math
import itertools
import collections

def inputArray(TYPE=int):
	return [TYPE(x) for x in input().split()]

def solve():
	day = 86400
	(n, t) = inputArray()
	a = inputArray()
	d = 0
	for x in a:
		if t <= 0:
			break
		t -= day - x
		d += 1
	print(d)
solve()


(n, t) = map(int, input().split())
a = input()
a = list(map(int, a.split()))
i = 0
kol = 0
while t > 0 and i < n:
	t -= 86400 - a[i]
	kol += 1
	i += 1
print(kol)


(n, k) = input().split(' ')
n = int(n)
k = int(k)
a = list(input().split(' '))
a = [int(i) for i in a]
s = 0
e = 0
for i in range(0, n):
	s += 86400 - a[i]
	if s >= k:
		e = i
		break
print(e + 1)


from math import ceil
s = 0
d = 0
(n, t) = map(int, input().split())
l = list(map(int, input().split()))
for i in range(n):
	d += 1
	s += 86400 - l[i]
	if s >= t:
		print(d)
		break


(d, t) = list(map(int, input().split()))
h = list(map(int, input().split()))
s = 86400
czas = 0
days = 0
for i in range(d):
	days += 1
	czas += s - h[i]
	if czas >= t:
		print(days)
		quit()


TIME_IN_A_DAY = 86400
(n, t) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(len(a)):
	if TIME_IN_A_DAY - a[i] >= t:
		print(i + 1)
		break
	t -= TIME_IN_A_DAY - a[i]


R = lambda : list(map(int, input().split()))
(n, t) = R()
a = R()
for i in range(n):
	t -= 86400 - a[i]
	if t < 1:
		print(i + 1)
		return


(n, t) = map(int, input().split())
cur = 0
pf = list(map(int, input().split()))
ans = n
for i in range(n):
	a = pf[i]
	cur = cur + 86400 - a
	if cur >= t:
		ans = i + 1
		break
print(ans)


n = input()
t = input()
test = n.split(' ')
a = t.split(' ')
time = int(test[1])
count = 1
for k in a:
	num = int(k)
	time = time - (86400 - num)
	if time <= 0:
		print(count)
		break
	count = count + 1


def main():
	MAX = 86400
	(n, t) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 1
	for x in a:
		t -= MAX - x
		if t <= 0:
			print(ans)
			return
		ans += 1
main()


(n, time) = [int(i) for i in input().split()]
days = [int(i) for i in input().split()]
for i in range(n):
	time -= 86400 - days[i]
	if time <= 0:
		print(i + 1)
		break


def main():
	day = 86400
	(n, x) = map(int, input().split())
	a = list(map(int, input().split()))
	if n < 1 or n > 100 or x < 1 or (x > 1000000) or (len(a) != n):
		print('NO')
		return
	else:
		ctr = 1
		for d in a:
			x -= max(day - d, 0)
			if x <= 0:
				print(ctr)
				return
			ctr += 1
main()


(n, t) = map(int, input().split())
arr = [int(x) for x in input().split()]
count = 0
sum = 0
for i in range(len(arr)):
	diff = 86400 - arr[i]
	sum += diff
	if sum >= t:
		count += 1
		break
	elif sum < t:
		count += 1
print(count)


inp = input().split()
n = eval(inp[0])
t = eval(inp[1])
inp = input().split()
a = [eval(i) for i in inp]
ans = 0
for i in range(n):
	t -= 86400 - a[i]
	ans = i
	if t <= 0:
		break
ans += 1
while t > 0:
	t -= 86400
	ans += 1
print(ans)


import math
(x, y) = map(int, input().split())
p = list(map(int, input().split()))
for i in range(x):
	k = 86400 - p[i]
	if k >= y:
		print(i + 1)
		exit()
	else:
		y -= k


d = input().split(' ')
n = int(d[0])
sayfa = int(d[1])
i = 0
d = list(map(lambda x: int(x), input().split(' ')))
while sayfa > 0:
	sayfa = sayfa - (86400 - d[i])
	i += 1
print(i)


(n, t) = map(int, input().split())
nums = list(map(int, input().split()))
res = 0
left = t
for item in nums:
	left -= 86400 - item
	res += 1
	if left <= 0:
		break
print(res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	(n, t) = LI()
	a = LI()
	k = 0
	for i in range(n):
		k += 86400 - a[i]
		if k >= t:
			return i + 1
	return -1
print(main())


def main():
	[n, t] = [int(_) for _ in input().split()]
	a = [int(_) for _ in input().split()]
	reading = 0
	day = 0
	for i in range(n):
		reading += 86400 - a[i]
		if reading >= t:
			day = i + 1
			break
	print(day)
main()


[n, t] = [int(i) for i in input().split(' ')]
work = [int(i) for i in input().split(' ')]
day = 0
for i in range(n):
	time_left = 86400 - work[i]
	t -= time_left
	day += 1
	if t <= 0:
		break
print(day)


R = lambda : list(map(int, input().split()))
(n, t) = R()
list = R()
for i in range(n):
	t -= 86400 - list[i]
	if t <= 0:
		print(i + 1)
		break


(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
p = list(map(int, input().strip().split(' ')))
d = 0
x = 0
for i in range(n):
	d = 86400 - p[i]
	x = x + d
	if x >= k:
		print(i + 1)
		break


(n, t) = map(int, input().split())
A = [int(x) for x in input().split()]
day = 86400
result = -1
for i in range(n):
	if t - (day - A[i]) <= 0:
		result = i + 1
		break
	else:
		t -= day - A[i]
print(result)


def solution(l1, l2):
	i = 0
	timer = l1[1]
	while i < len(l2):
		timey = 86400
		if timey - l2[i] >= timer:
			return i + 1
		timer = max(0, timer - (timey - l2[i]))
		i += 1

def answer():
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	print(solution(l1, l2))
answer()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
from sys import stdin, stdout
input = stdin.readline

def MAP():
	return map(int, input().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]
(n, t) = MAP()
sec = LI()
c = 1
for j in range(n):
	sec[j] = 86400 - sec[j]
	if sec[j] >= t:
		print(c)
		break
	else:
		c += 1
		t -= sec[j]


(n, t) = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
j = 0
for i in range(n):
	if t > 0:
		j = j + 1
		t = t + l[i] - 86400
	else:
		break
print(j)


(days, read) = map(int, input().split(' '))
day = 0
schedule = [int(x) for x in input().strip().split(' ')]
for s in schedule:
	toread = 86400 - s
	read -= toread
	day += 1
	if read <= 0:
		break
print(day)


[n, t] = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
i = 0
while t > 0:
	t -= 86400 - L[i]
	i += 1
print(i)


(n, t) = map(int, input().split())
ans = 0
for day in input().split():
	ans += 1
	t -= 86400 - int(day)
	if t <= 0:
		print(ans)
		break


(n, t) = map(int, input().split())
for (i, ai) in enumerate(map(int, input().split())):
	t -= 86400 - ai
	if t <= 0:
		print(i + 1)
		break


def read_int():
	return list(map(int, input().split()))
SECONDS_PER_DAY = 86400
(num_of_day, time_required) = read_int()
working_seconds = read_int()
cnt = 1
for second in working_seconds:
	ret = SECONDS_PER_DAY - second
	if ret >= time_required:
		break
	else:
		time_required -= ret
		cnt += 1
print(cnt)


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
cur = 1
ct = 0
while t > 0:
	free = 86400 - A[ct]
	ct += 1
	if free >= t:
		print(cur)
		break
	else:
		t -= free
		cur += 1


a1 = input().split()
a = [int(a1[i]) for i in range(len(a1))]
b1 = input().split()
b = [86400 - int(b1[i]) for i in range(len(b1))]
s = 0
for i in range(a[0]):
	s += b[i]
	if s >= a[1]:
		print(i + 1)
		break


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
for i in a:
	if i == 86400:
		cnt += 1
	elif i < 86400 and 86400 - i < t:
		x = 86400 - i
		t = t - x
		cnt += 1
	elif i < 86400 and 86400 - i >= t:
		cnt += 1
		break
print(cnt)


(n, k) = list(map(int, input().split()))
a = list(map(int, input().split()))
count = 0
i = 0
while i < n:
	if k <= 0:
		break
	else:
		s = 86400 - a[i]
		if k < s:
			count += 1
			break
		else:
			count += 1
			k = k - s
	i += 1
print(count)


(n, t) = [int(i) for i in input().split()]
a = [int(j) for j in input().split()]
for i in range(n):
	c = 86400 - a[i]
	t -= c
	if t <= 0:
		print(i + 1)
		break


(n, t) = (int(x) for x in input().split())
ns = [int(x) for x in input().split()]
for i in range(1, n + 1):
	t -= 86400 - ns[i - 1]
	if t <= 0:
		print(i)
		break


(n, t) = map(int, input().split())
l = map(int, input().split())
x = 0
for i in l:
	if i == 86400:
		x += 1
	elif i < 86400 and 86400 - i > 0:
		t = t - (86400 - i)
		x += 1
	if t <= 0:
		break
print(x)


n = [int(x) for x in input().strip().split()]
m = [int(y) for y in input().strip().split()]
count = 0
for i in range(n[0]):
	count += 86400 - m[i]
	if count >= n[1]:
		print(i + 1)
		break


line1 = input().split()
n = int(line1[0])
t = int(line1[1])
line2 = input().split()
working = []
for i in range(n):
	working.append(int(line2[i]))
days = 0
while t > 0:
	t = t - (86400 - working[days])
	days += 1
print(days)


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
day = 0
while t > 0:
	t -= 86400 - a[day]
	day += 1
print(day)


(n, t) = input().split()
n = int(n)
t = int(t)
days = 0
for i in input().split():
	free_time = 86400 - int(i)
	days += 1
	t -= free_time
	if t <= 0:
		break
print(days)


(n, t) = input().split(' ')
i = 0
(n, t) = (int(n), int(t))
a = input().split(' ')
while t > 0:
	t = t - 86400 + int(a[i])
	i = i + 1
print(i)


def min_day(nday, r_time, arr):
	total = 0
	i = 0
	while total < r_time and i <= nday:
		total += 86400 - arr[i]
		i += 1
	return i
(n_day, time) = map(int, input().split())
array = list(map(int, input().split()))
print(min_day(n_day, time, array))


s = input().split()
(n, t) = (int(s[0]), int(s[1]))
d = 0
for ai in input().split():
	t -= 86400 - int(ai)
	d += 1
	if t <= 0:
		break
print(d)


(n, t) = map(int, input().split())
num = list(map(int, input().split()))
i = 0
sum1 = 0
while sum1 < t and i < len(num):
	sum1 += 86400 - num[i]
	i += 1
print(i)


(n, t) = map(int, input().split())
w = list(map(int, input().split()))
count = 0
while t > 0:
	t -= 86400 - w[count]
	count += 1
print(count)


MAX_DAY = 86400
(days, needed) = map(int, input().split())
times = list(map(int, input().split()))
res = 0
for t in times:
	needed -= MAX_DAY - t
	res += 1
	if needed <= 0:
		break
print(res)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(n, t) = get_int_list()
lst = get_int_list()
for i in range(n):
	time_rem = 86400 - lst[i]
	if t <= time_rem:
		print(i + 1)
		break
	else:
		t -= time_rem


arr1 = list(map(int, input().strip().split()))
arr2 = list(map(int, input().strip().split()))
n = arr1[0]
t = arr1[1]
time = 0
for i in range(n):
	time += 86400 - arr2[i]
	if time >= t:
		print(i + 1)
		break
	else:
		continue


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
days = 0
i = 0
while i < len(a) and t > 0:
	t -= 86400 - a[i]
	days += 1
	i += 1
print(days)


def main():
	(n, t) = map(int, input().split())
	time = list(map(int, input().split()))
	cnt = 0
	for i in range(0, n):
		timeleft = 86400 - time[i]
		t = t - timeleft
		cnt = cnt + 1
		if t <= 0:
			print(cnt)
			return
main()


DAY = 86400
(n, t) = map(int, input().split())
A = list(map(int, input().split()))
for i in range(n):
	t -= min(t, DAY - A[i])
	if t == 0:
		print(i + 1)
		exit()


(x, y) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(x):
	if y - (86400 - a[i]) < 1:
		print(i + 1)
		break
	else:
		y = y - (86400 - a[i])


(n, t) = [int(elem) for elem in input().split(' ')]
vals = [86400 - int(elem) for elem in input().split(' ')]
day = 0
total = 0
while total < t:
	total += vals[day]
	day += 1
print(day)


(n, t) = list(map(int, input().split()))
worktime = list(map(int, input().split()))
freetime = []
for i in range(n):
	freetime.append(86400 - worktime[i])
sumread = 0
counter = 0
for i in range(n):
	if sumread < t:
		counter += 1
		sumread += freetime[i]
print(counter)


(a, b) = [int(x) for x in input().split()]
lst = [int(x) for x in input().split()]
x = 86400
left = 0
count = 0
for data in lst:
	count += 1
	left = left + x - data
	if left >= b:
		print(count)
		break


(n, t) = map(int, input().split())
sec = list(map(int, input().split()))
c = 1
for j in range(n):
	sec[j] = 86400 - sec[j]
	if sec[j] >= t:
		print(c)
		break
	else:
		c += 1
		t -= sec[j]


def book(t, arr):
	ans = 0
	while t > 0:
		t -= 86400 - arr.pop(0)
		ans += 1
	return ans
(n, t) = list(map(int, input().split()))
arr = list(map(int, input().split()))
print(book(t, arr))


(days, t) = input().split()
(days, t) = (int(days), int(t))
a = list(map(int, input().split()))
c = 0
while t > 0:
	t -= 86400 - a[c]
	c += 1
print(c)


(n, t) = map(int, input().strip().split(' '))
A_i = [int(n) for n in input().split()]
Remain = 0
remain = 0
const = 86400
i = 0
while t > 0:
	remain = const - A_i[i]
	t = t - remain
	remain = 0
	i += 1
print(i)


Read = lambda : map(int, input().split())
from functools import reduce
while True:
	try:
		(n, t) = Read()
	except:
		break
	L = list((86400 - x for x in Read()))
	(ans, sum) = (0, 0)
	for x in L:
		sum += x
		ans += 1
		if sum >= t:
			print(ans)
			break


def main():
	buff = input().split()
	(n, t) = (int(buff[0]), int(buff[1]))
	arr = list(map(int, input().split()))
	day = 0
	while t > 0:
		day += 1
		t -= 86400 - arr.pop(0)
	return day
print(main())


from math import ceil
(n, t) = map(int, input().split())
trabalho = list(map(int, input().split()))
dia = 86400
d = 0
for d in range(n):
	t -= dia - trabalho[d]
	d += 1
	if t <= 0:
		break
if t > 0:
	d += ceil(t / dia)
print(d)


s = input().split()
n = int(s[0])
t = int(s[1])
s1 = input().split()
for i in range(1, n + 1):
	time = int(s1[i - 1])
	t = t - (86400 - time)
	if t > 0 and i == n:
		print(n)
		break
	if t <= 0:
		print(i)
		break


(n, t) = map(int, input().split())
A = list(map(int, input().split()))
D = 86400
for i in range(n):
	if D - A[i] >= t:
		print(i + 1)
		break
	else:
		t -= D - A[i]


def count_days(lst_of_hours, read_time):
	num_of_days = 0
	for a in lst_of_hours:
		read_time -= 86400 - a
		num_of_days += 1
		if read_time <= 0:
			return num_of_days
	return num_of_days + 1 + read_time // 86400
(n, t) = map(int, input().strip().split())
working_hours = list(map(int, input().strip().split())) * 100
print(count_days(working_hours, t))


(n, t) = map(int, input().split())
arr = list(map(int, input().split()))
k = 0
val = 0
for i in arr:
	diff = 86400 - i
	val = val + diff
	k += 1
	if val >= t:
		print(k)
		break
	else:
		continue


(n, t) = map(int, input().split())
work = list(map(int, input().split()))
time = 0
for i in range(n):
	time += 86400 - work[i]
	if time >= t:
		print(i + 1)
		break


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
i = -1
while k > 0:
	i += 1
	k -= 86400 - a[i]
print(i + 1)


(a, b) = input().split(' ')
c = input()
c = c.split(' ')
x = 0
z = 0
b = int(b)
while b > 0:
	z += 1
	b -= 86400 - int(c[x])
	x += 1
print(z)


(n, t) = map(int, input().split())
lst = [int(x) for x in input().split()]
(count, test) = (0, 0)
for i in lst:
	test += 86400 - i
	count += 1
	if test >= t:
		print(count)
		break


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
c = 86400
s = 0
i = 0
while s < t:
	s += c - a[i]
	i += 1
print(i)


(n, t) = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
for i in range(len(l)):
	diff = 86400 - l[i]
	if t <= diff:
		print(i + 1)
		break
	else:
		t -= diff


from sys import stdin, stdout

def main():
	sec_day = 86400
	(n, t) = map(int, stdin.readline().split())
	cnt = 0
	for cur in stdin.readline().split():
		cur = int(cur)
		t -= sec_day - cur
		cnt += 1
		if t <= 0:
			stdout.write(str(cnt))
			break
main()


(n, t) = map(int, input().split())
lst = []
for x in input().split():
	lst.append(int(x))
i = 0
k = 0
while t > 0:
	t -= 86400 - lst[i]
	i += 1
	k += 1
print(k)


IL = lambda : list(map(int, input().split()))
I = lambda : int(input())
(n, t) = IL()
a = IL()
for (i, aa) in enumerate(a):
	t -= 86400 - aa
	if t <= 0:
		print(i + 1)
		break


(sutki, book) = list(map(int, input().split()))
d = list(map(int, input().split()))
i = 0
while book > 0:
	book -= 86400 - d[i]
	i += 1
print(i)


inp = lambda : map(int, input().split())
(n, t) = inp()
a = list(inp())
sum = 0
for i in range(n):
	sum += 86400 - a[i]
	if sum >= t:
		print(i + 1)
		break


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
count = 0
for i in l:
	time = 86400 - i
	t = t - time
	count += 1
	if t <= 0:
		break
print(count)


(n, t) = map(int, input().split(' '))
l = input().split(' ')
j = 0
i = 0
while t > 0:
	t = t - (86400 - int(l[i]))
	i = i + 1
	j = j + 1
print(j)


(n, t) = map(int, input().split())
a = lambda : map(int, input().split())
l = list(a())
count = 0
for i in range(n):
	if t - (86400 - l[i]) > 0:
		t = t - (86400 - l[i])
		count += 1
	else:
		count += 1
		break
print(count)


R = lambda : map(int, input().split())
(n, t) = R()
tday = 86400
counter = 0
tdays = R()
for i in tdays:
	counter += 1
	if 0 >= t - (tday - i):
		break
	t -= tday - i
print(counter)


(x, t) = map(int, input().split())
s = [int(n) for n in input().split()]
p = 24 * 3600
m = 0
for n in s:
	j = p - n
	t -= j
	m += 1
	if t <= 0:
		break
print(m)


(n, t) = map(int, input().split())
l = list(map(int, input().split()))
secs = 0
days = 0
for tm in l:
	if secs >= t:
		break
	secs += 86400 - tm
	days += 1
print(days)


(n, t) = input().split(' ')
n = int(n)
t = int(t)
a = list(map(int, input().split()))
b = 0
vrema = 86400
for c in range(n):
	b = b + vrema - a[c]
	if b >= t:
		print(c + 1)
		break


(n, t) = [int(i) for i in input().split()]
l = [int(i) for i in input().split(' ')]
cur = 0
for i in range(n):
	cur += 86400 - l[i]
	if cur >= t:
		print(i + 1)
		exit(0)


(n, t) = map(int, input().split())
l = [int(i) for i in input().split()]
diff = [0] * n
for i in range(n):
	diff[i] = 86400 - l[i]
i = 0
cnt = 1
curr = 0
while i < n and curr < t:
	cnt += 1
	curr += diff[i]
	i += 1
print(cnt - 1)


(n, t) = list(map(int, input().split()))
a = list(map(int, input().split()))
for _ in range(n):
	t = t + a[_] - 86400
	if t <= 0:
		print(_ + 1)
		break


(n, t) = map(int, input().split())
lst = [int(i) for i in input().split()]
for (i, val) in enumerate(lst):
	t -= 86400 - val
	if t <= 0:
		print(i + 1)
		break


(n, t) = list(map(int, input().split()))
fl = 0
nn = list(map(int, input().split()))
for i in range(0, n):
	tl = 86400 - nn[i]
	t = t - tl
	if t <= 0 and fl == 0:
		fl = 1
		po = i + 1
print(po)


s = input().split()
n = int(s[0])
t = int(s[1])
x = input().split()
ans = 1
for i in range(0, n):
	t -= 86400 - int(x[i])
	if t <= 0:
		break
	else:
		ans += 1
print(ans)


cin = lambda : map(int, input().split())
(n, m) = cin()
a = list(cin())
for i in range(n):
	m -= 86400 - a[i]
	if m <= 0:
		print(i + 1)
		exit()


(nod, needed) = [int(x) for x in input().split()]
worktime = [int(x) for x in input().split()]
days = 0
for i in range(nod):
	needed -= 86400 - worktime[i]
	days += 1
	if needed <= 0:
		break
print(days)


(n, t) = map(int, input().split())
w = list(map(int, input().split()))
day = 0
i = 0
while i <= n - 1:
	if t <= 0:
		break
	free = 86400 - w[i]
	t = t - free
	day = day + 1
	i = i + 1
print(day)


(n, t) = map(int, input().split())
a = map(int, input().split())
for (index, elem) in enumerate(a):
	t -= 86400 - elem
	if t <= 0:
		print(index + 1)
		break


(n, t) = list(map(int, input().split()))
l = list(map(int, input().split()))
val = 0
k = 0
a = 1
for i in l:
	val = 86400 - i
	k += val
	if k - t >= 0:
		print(a)
		break
	a += 1


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
(ans, c) = (0, 0)
i = 0
while 1:
	if ans >= k:
		break
	else:
		ans = ans + (86400 - l[i])
		i += 1
	c += 1
print(c)


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = a[1]
d = 0
i = 0
while c > 0:
	d += 1
	c = c - (86400 - b[i])
	i += 1
print(d)


day = 86400
(n, t) = input().strip().split(' ')
(n, t) = [int(n), int(t)]
a = list(map(int, input().split()))
count = 0
for i in a:
	rest = day - i
	t -= rest
	count += 1
	if t <= 0:
		break
print(count, end='')


(n, t) = map(int, input().split())
a = list(map(int, input().split()))
q = 0
for x in range(len(a)):
	q += 86400 - a[x]
	if t <= q:
		print(x + 1)
		break