题解 | #罪犯转移#
罪犯转移
https://www.nowcoder.com/practice/b7b1ad820f0a493aa128ed6c9e0af448
while True: try: n, t, c = map(int, input().split()) persons = list(map(int, input().split())) pos = c tmp = sum(persons[:pos]) res = 0 if tmp <= t: res += 1 for i in range(pos, n): tmp += persons[i] tmp -= persons[i - pos] if tmp <= t: res += 1 print(res) except: break