Math, asked by Darshananand8361, 1 year ago

One day chinky was roaming around the park and suddenly she found n bags with diamonds. The i'th of these bags contains ai diamonds. She felt greedy and started to pick up the bag very fastly. But due to quick movement, she drops it on the ground. But as soon as she drops the bag, a genie appears in front of her and he increases the number of diamonds in the bag suddenly

Answers

Answered by ItsCuteBoy
1

Answer:

The i'th of these bags contains ai diamonds. She felt greedy and started to pick up the bag very fastly.

Answered by mindfulmaisel
0

Chinky's maximum number of diamonds she can carry.

Step-by-step explanation:

#include <bits/stdc++.h>

#define ll long long int

using namespace std;

int main() {

int a; cin>>a; while(a--){

    ll l,k,x,ans=0; cin>>l>>k;

 

    for(int i=0; i<l; i++){

    priority_queue<ll> m;

        cin>>x;

        m.push(x);

    }

    for(int i=0; i<k; i++){

        ll a=m.top();

        ans+=a;

        m.pop();

        m.push(p/2);

    }

    cout<<answer<<end;

   

}

return 0;

}

Similar questions