import re import sys content = input() pattern = r'^(\d+) (\d+)$' result = re.match(pattern, content) if not result: sys.exit("format error.") N, K = map(int, content.split()) if not (1 <= N and N <= 3*10**5): sys.exit("N") if not (2 <= K and K <= 1300): sys.exit("K") content = input() pattern = r'^(-?\d+)( (-?\d+))*$' result = re.match(pattern, content) if not result: sys.exit("format error.") A = list(map(int, content.split())) if len(A) != N: sys.exit("A") sum = 0 for i in range(N): if not (1 <= A[i] and A[i] <= 998244352): sys.exit("A[i]") sum += A[i] if not (K <= sum): sys.exit("sum")