#include #include #include using namespace std; vector A1; vector A2; vector B2; int main() { long long N,M,K; cin >> N >> M >> K; A1.resize(N); for(int i=0; i> A1[i]; if(K/2 >= 0) A2.push_back(0); if(K/2 >= 1) for(int i=0; i= 2) for(int i=0; i= 3) for(int i=0; i= 0) B2.push_back(0); if((K+1)/2 >= 1) for(int i=0; i= 2) for(int i=0; i= 3) for(int i=0; i M) q--; for(std::size_t p=0; p M && q != 0) q--; if(ans < A2[p] + B2[q]) ans = A2[p] + B2[q]; } cout << ans << '\n'; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } ios_do_not_sync_instance;