using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ dp=new int[D+1][]; int[][][] route=new int[D+1][][]; for(int i=0;i=0;k--){ for(int d=D;d>=0;d--){ if(dp[d][k]==0)continue; if(d+i<=D){ dp[d+i][k+1]=1; bool chk=true; route[d][k][k]=i; for(int rr=0;rrroute[d][k][rr]){ chk=false;break; } } if(!chk){ for(int rr=0;rrint.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }