起因:被坏心眼子学弟推题然后真的写了
#include <bits/stdc++.h>
using namespace std;
inline int read(){
int x=0; bool f=1; char c=getchar();
while(c<48||c>57) f^=(c==45), c=getchar();
while(c>=48&&c<=57) x=x*10+(c&15), c=getchar();
return f?x:-x;
}
priority_queue<int> q;
int n, a, b; long long ans=0;
int main(){
n=read(), a=read(), b=read();
for(int i=1; i<=n; i++) q.push(read());
while(a>1) q.push(sqrt(q.top())), q.pop(), a--;
if(n>1&&a){
int x=q.top(), y=sqrt(x); q.pop();
if((y&1)&&x==y*y&&q.top()==y*y-1)
q.pop(), q.push(x>>1), q.push(y-1), b--;
else q.push(y);
}else q.push(sqrt(q.top())), q.pop();
while(b) q.push(q.top()>>1), q.pop(), b--;
while(!q.empty()) ans+=q.top(), q.pop();
cout<<ans<<endl;
return 0;
}