#include <stdio.h>
#include <stdlib.h>
int solve() {
int n, q;
scanf("%d %d", &n
, &q
); // モンスター数 n, 魔法玉数 q
int *defense
= (int *)malloc(n
* sizeof(int)); for (int i = 0; i < n; i++) {
scanf("%d", &defense
[i
]); // 各モンスターの防御力 }
// 魔法玉を使う
for (int i = 0; i < q; i++) {
// 最大値を探す
int maxIndex = 0;
for (int j = 1; j < n; j++) {
if (defense[j] > defense[maxIndex]) {
maxIndex = j;
}
}
// 最大値を1/2にする
defense[maxIndex] /= 2;
}
// 総防御力を計算
int totalDefense = 0;
for (int i = 0; i < n; i++) {
totalDefense += defense[i];
}
return totalDefense;
}
int main(void) {
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBzb2x2ZSgpIHsKICAgIGludCBuLCBxOwogICAgc2NhbmYoIiVkICVkIiwgJm4sICZxKTsgLy8g44Oi44Oz44K544K/44O85pWwIG4sIOmtlOazleeOieaVsCBxCgogICAgaW50ICpkZWZlbnNlID0gKGludCAqKW1hbGxvYyhuICogc2l6ZW9mKGludCkpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICBzY2FuZigiJWQiLCAmZGVmZW5zZVtpXSk7IC8vIOWQhOODouODs+OCueOCv+ODvOOBrumYsuW+oeWKmwogICAgfQoKICAgIC8vIOmtlOazleeOieOCkuS9v+OBhgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBxOyBpKyspIHsKICAgICAgICAvLyDmnIDlpKflgKTjgpLmjqLjgZkKICAgICAgICBpbnQgbWF4SW5kZXggPSAwOwogICAgICAgIGZvciAoaW50IGogPSAxOyBqIDwgbjsgaisrKSB7CiAgICAgICAgICAgIGlmIChkZWZlbnNlW2pdID4gZGVmZW5zZVttYXhJbmRleF0pIHsKICAgICAgICAgICAgICAgIG1heEluZGV4ID0gajsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgLy8g5pyA5aSn5YCk44KSMS8y44Gr44GZ44KLCiAgICAgICAgZGVmZW5zZVttYXhJbmRleF0gLz0gMjsKICAgIH0KCiAgICAvLyDnt4/pmLLlvqHlipvjgpLoqIjnrpcKICAgIGludCB0b3RhbERlZmVuc2UgPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICB0b3RhbERlZmVuc2UgKz0gZGVmZW5zZVtpXTsKICAgIH0KCiAgICBmcmVlKGRlZmVuc2UpOwogICAgcmV0dXJuIHRvdGFsRGVmZW5zZTsKfQoKaW50IG1haW4odm9pZCkgewogICAgcHJpbnRmKCIlZFxuIiwgc29sdmUoKSk7CiAgICByZXR1cm4gMDsKfQo=