package no393; import java.util.Arrays; import java.util.Scanner; public class Main { public static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int d = sc.nextInt(); for(int i=0;i=a[i];j--) { dp[j] |= dp[j-a[i]]; } } boolean flag = false; for(int i=l1;i>=0;i--) { if (dp[i]) { flag = sum - i <= l2; break; } } if (flag) { l = c; }else{ r = c; } } System.out.println(l); } }