import java.util.Scanner; public class Yuki1{ public static void main(String[] arg){ Scanner sc = new Scanner(System.in); int n,c,v,res = 50000; boolean find=false; n = sc.nextInt(); c = sc.nextInt(); v = sc.nextInt(); int[] s = new int[v]; int[] t = new int[v]; int[] y = new int[v]; int[] m = new int[v]; for(int i = 0;i dp[i][k] + m[j]){ dp[t[j]][k+y[j]] = dp[i][k] + m[j]; } } } } for(int i = 0; i dp[n][i]){ res = dp[n][i]; find = true; } } } if(find){ System.out.println(res); }else{ System.out.println(-1); } } }