func main() var n: int :: cui@inputInt() var m: int :: cui@inputInt() var k: int :: cui@inputInt() var dp: [][]bool :: #[n + 1, k + 1]bool do dp[0][0] :: true for i(1, n) for(1, m) var a: int :: cui@inputInt() for j(0, k - 1) if(dp[i - 1][j] & j + a <= k) do dp[i][j + a] :: true end if end for end for end for var ans: int :: -1 for j(0, k) if(dp[n][j]) do ans :: k - j end if end for do cui@print("\{ans}\n") end func