# nowcoder-第三届湖北省赛-Mr.Maxwell and attractions (贪心)

2 1 4 2
4 3
7


18.20


7 + 7 * 0.6 + 4 + 3 == 18.20

#include<bits/stdc++.h>
using namespace std;
const int N = 100010;
priority_queue<double,vector<double>,less<double> >q1;//室内
priority_queue<double,vector<double>,less<double> >q2;//室外
int main()
{
int n,m,k,t; cin >> n >> m >> t >> k;
for(int i=1;i<=n;i++)
{
double x; cin >> x;
q1.push(x);
}
for(int i = 1;i <= m;i++)
{
double x; cin >> x;
q2.push(x);
}
k = t - k;
double ans = 0;
for(int i = 1;i <= k;i++)
{
double x = q1.top();q1.pop();
double y = q2.top();q2.pop();
if(x >= y)
{
ans += x;
x *= 0.6;
}
else{
ans += y;
y *= 0.6;
}
q1.push(x);
q2.push(y);
}
k = t - k;
for(int i = 1;i <= n;i++)
{
double x = q1.top();q1.pop();
double y = q2.top();q2.pop();
if(x >= y * 0.8){
ans += x;
x *= 0.6;
}
else{
ans += y * 0.8;
y *= 0.6;
}
q1.push(x);
q2.push(y);
}
printf("%.2lf",ans);
return 0;
}


int n,m,t,k;
priority_queue<double> quea,queb;
int main() {
cin >> n >> m >> t >> k;
for(int i=1; i<=n; i++) {
double t; cin >> t;
quea.push(t);
}
for(int i=1; i<=m; i++) {
double t; cin >> t;
queb.push(t);
}
double ans = 0;
k = t-k;
for(int i=1;i<=t;i++){
double topa = quea.top();
double topb = queb.top();
double mul = 1.0;
if(k <= 0) mul = 0.8;///afternoon
if(topa > topb * mul){
ans += topa;
quea.pop();quea.push(topa * 0.6);
}else{
ans += topb * mul;
queb.pop();queb.push(topb * 0.6);
k --;
}
}
printf("%.2lf\n",ans);
return 0;
}//ac_code


05-10 4209
03-05