import java.io.*; import java.util.*; /** * Dynamic programming solution. The state is the number of problems chosen so far * and the two most difficult problems chosen. Process the problems in order of * difficulty. * * @author Finn Lidbetter */ public class cc_finn { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(" "); int n = Integer.parseInt(s[0]); int k = Integer.parseInt(s[1]); long[] problems = new long[n]; for (int i=0; i=k) { maxProblemsSoFar = k-1; } for (int i=1; i<=maxProblemsSoFar; i++) { for (int j=0; j