#include <stdio.h>
#include <stdlib.h>
//必要があれば,関数をいくつでも追加して良い
int compare(const void *a, const void *b) {
return *(int *)b - *(int *)a; // 降順にソート
}
int solve(){
int ret;
int n, q;
int d[n];
// 防御力の入力
for (int i = 0; i < n; i++) {
}
// 防御力を最大ヒープ(降順)でソート
qsort(d
, n
, sizeof(int), compare
);
// 魔法ボールをq個使う
for (int i = 0; i < q; i++) {
// 最も防御力が高いモンスターを半分にする
d[0] = d[0] / 2;
// ソートして最大値を再調整
qsort(d
, n
, sizeof(int), compare
); }
// 最終的な防御力の合計を計算
ret = 0; // 初期化
for (int i = 0; i < n; i++) {
ret += d[i];
}
return ret;
}
//メイン関数はいじらなくて良い
int main(void){
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KIAovL+W/heimgeOBjOOBguOCjOOBsO+8jOmWouaVsOOCkuOBhOOBj+OBpOOBp+OCgui/veWKoOOBl+OBpuiJr+OBhAogaW50IGNvbXBhcmUoY29uc3Qgdm9pZCAqYSwgY29uc3Qgdm9pZCAqYikgewogICAgcmV0dXJuICooaW50ICopYiAtICooaW50ICopYTsgIC8vIOmZjemghuOBq+OCveODvOODiAp9CgppbnQgc29sdmUoKXsKICAgIGludCByZXQ7CiAgICBpbnQgbiwgcTsKICAgIHNjYW5mKCIlZCAlZCIsICZuLCAmcSk7CiAgICAKICAgIGludCBkW25dOwogICAgCiAgICAvLyDpmLLlvqHlipvjga7lhaXlipsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgc2NhbmYoIiVkIiwgJmRbaV0pOwogICAgfQogICAgCiAgICAvLyDpmLLlvqHlipvjgpLmnIDlpKfjg5Ljg7zjg5fvvIjpmY3poIbvvInjgafjgr3jg7zjg4gKICAgIHFzb3J0KGQsIG4sIHNpemVvZihpbnQpLCBjb21wYXJlKTsKICAgIAogICAgLy8g6a2U5rOV44Oc44O844Or44KSceWAi+S9v+OBhgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBxOyBpKyspIHsKICAgICAgICAvLyDmnIDjgoLpmLLlvqHlipvjgYzpq5jjgYTjg6Ljg7Pjgrnjgr/jg7zjgpLljYrliIbjgavjgZnjgosKICAgICAgICBkWzBdID0gZFswXSAvIDI7CiAgICAgICAgCiAgICAgICAgLy8g44K944O844OI44GX44Gm5pyA5aSn5YCk44KS5YaN6Kq/5pW0CiAgICAgICAgcXNvcnQoZCwgbiwgc2l6ZW9mKGludCksIGNvbXBhcmUpOwogICAgfQogICAgCiAgICAvLyDmnIDntYLnmoTjgarpmLLlvqHlipvjga7lkIjoqIjjgpLoqIjnrpcKICAgIHJldCA9IDA7ICAvLyDliJ3mnJ/ljJYKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CiAgICAgICAgcmV0ICs9IGRbaV07CiAgICB9CiAgICAKICAgIHJldHVybiByZXQ7Cn0KIAovL+ODoeOCpOODs+mWouaVsOOBr+OBhOOBmOOCieOBquOBj+OBpuiJr+OBhAppbnQgbWFpbih2b2lkKXsKICAgIHByaW50ZigiJWRcbiIsc29sdmUoKSk7CiAgICByZXR1cm4gMDsKfQo=