public long maxRunTime(int n, int[] batteries) {         Arrays.sort(batteries);         long sum=0;         for(int i=0;i<batteries.length;i++){sum+=batteries[i];}         for(int i=batteries.length-1;i>=0;i--){             long ans=sum/n;             if(batteries[i]<=ans){return ans;}             sum-=batteries[i];             n--;         }         return -1;     } 贴一个大佬的做法