import strutils, sequtils const inf = 987654321 var c = stdin.readLine.parseInt n = stdin.readLine.parseInt a = newSeqWith(n, 0) dp = newSeqWith(n+1, newSeqWith(c+1, -1)) var sp = stdin.readLine.split for i in 0..