第二题,ac static int maxAmount(int[] packets, int n) {         int ans=fun(packets,0,n+1);         return ans;     }     static Map<String,Integer>map=new HashMap<>();     private static int fun(int[] packets, int l, int n) {         int len = packets.length-l;         if(n==1){             int t=0;             for(int i=l;i<packets.length;i++){                 t+=packets[i];             }             return t;         }         int ans=0;         int t=0;         for(int i=1;i<=len-n+1;i++){             t+=packets[l+i-1];             String s=(l+i)+" "+(n-1);             int x;             if(map.containsKey(s)){                  x = map.get(s);             }else {                 x=fun(packets,l+i,n-1);                 map.put(s,x);             }             ans=Math.max(ans,Math.min(t,x));         }         return ans;     }