1class Solution {2public int minStoneSum(int[] A, int k) {3PriorityQueue<Integer> pq = new PriorityQueue<>((a, b) -> b - a);4int res = 0;5for (int a : A) {6pq.add(a);7res += a;8}9while (k-- > 0) {10int a = pq.poll();11pq.add(a - a / 2);12res -= a / 2;13}14return res;15}16}