#include using namespace std; using ll=long long; int main(){ ll n,m,w; cin>>n>>m>>w; vector a(n); for(ll i=0;i>a[i]; } sort(a.rbegin(),a.rend()); vector sum(n+1); sum[0]=0; sum[1]=a[0]; for(ll i=1;i b(m); for(ll i=0;i>b[i]; } vector c(m); for(ll i=0;i>c[i]; } ll ans=0; for(ll s=0;s<(1<=0){ rest=min(rest,n); tmpv+=sum[rest]; } ans=max(ans,tmpv); } } cout<