@@ -0,0 +1,1244 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int s = in.nextInt();%0A        int n = in.nextInt();%0A        int m = in.nextInt();%0A        int%5B%5D keyboards = new int%5Bn%5D;%0A        for(int keyboards_i=0; keyboards_i %3C n; keyboards_i++)%7B%0A            keyboards%5Bkeyboards_i%5D = in.nextInt();%0A        %7D%0A        int%5B%5D pendrives = new int%5Bm%5D;%0A        for(int pendrives_i=0; pendrives_i %3C m; pendrives_i++)%7B%0A            pendrives%5Bpendrives_i%5D = in.nextInt();%0A        %7D%0A        Arrays.sort(keyboards);%0A        Arrays.sort(pendrives);%0A        int max = 0;%0A        ArrayList%3CInteger%3E list = new ArrayList%3CInteger%3E();%0A        for(int i =0;i%3Cn;i++)%7B%0A            for(int j=0;j%3Cm;j++)%7B%0A                if(keyboards%5Bi%5D+pendrives%5Bj%5D%3C=s)%7B%0A                    list.add(keyboards%5Bi%5D+pendrives%5Bj%5D);%0A                %7D%0A            %7D%0A        %7D%0A        if(list.size()==0)%7B%0A            System.out.println(%22-1%22);%0A        %7D%0A        else%7B%0A            Collections.sort(list);%0A            System.out.println(list.get(list.size()-1));%0A        %7D%0A    %7D%0A                       %0A%7D%0A                       %0A

add ElectronicsShop.java