문제 : https://www.acmicpc.net/problem/2559 예제입력 : 10 2 3 -2 -4 -9 0 3 7 13 8 -3 예제출력 : 21 import sys input = sys.stdin.readline N,K = map(int, input().split()) nums = list(map(int, input().split())) each = 0 for i in range(K): each += nums[i] maxv = each for i in range(K, N): each += nums[i] each -= nums[i-K] maxv = max(each, maxv) print(maxv) 3 -2 -4 -9 0 3 7 13 8 -3 초기 인덱스는 3 + (-2) = 1 이 상태에서 ..