def solve(N, K, S):
if 0 in S:
return N
start = 0
result = 0
end = 1
prod = S[start]
while end < N:
if prod <= K:
result += 1
prod = prod * S[end]
end += 1
else:
prod = prod * S[end] // S[start]
start += 1
end += 1
if prod <= K:
result += 1
return result
def solve(N, K, S):
if 0 in S:
return N
if K == 0:
return 0
start = 0
result = 0
end = 1
prod = S[start]
while end < N:
if prod <= K:
result = max(result, end - start)
prod = prod * S[end]
end += 1
else:
prod = prod // S[start]
start += 1
if prod <= K:
result = max(result, end - start)
return result