N = int(input()) A = list(map(int, input().split())) dp = [-1]*(1<=0: dp[i+(1<