Getting Runtime Error is Knapsack Problem in few testcases

Getting Runtime Error in few test cases in Knapsack Problem https://ide.codingblocks.com/s/384734 https://atcoder.jp/contests/dp/tasks/dp_d
Logic is Correct but some error

Please Reply as Early as possible