#include using namespace std; using ll = long long; using vl = vector; #define rep(i,n) for(int i=0;i<(n);i++) #define rrep(i,n) for(int i=(n)-1;i>=0;i--) #define rep1(i,n) for(int i=1;i<=(n);i++) #define rrep1(i,n) for(int i=(n);i>0;i--) #define fore(i_in,a) for (auto& i_in: a) #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define cnts(x,c) count(all(x),c) #define fio() cin.tie(nullptr);ios::sync_with_stdio(false); #define DEBUG_CTN(v) cerr<<#v<<":";for(auto itr=v.begin();itr!=v.end();itr++) cerr<<" "<<*itr; cerr< bool chmax(T &a, const T &b) {if (a bool chmin(T &a, const T &b) {if (a>b) {a = b; return 1;} return 0;} template void print(const T &t) {cout< void PRINT(const T &t) {rep(i,sz(t)) cout<>n>>k>>p; a=b=vl(n); fore(x,a) cin>>x; fore(x,b) cin>>x; sort(all(a));sort(all(b)); ll ng=0,ok=10010010010; while(ok-ng>1LL){ ll mid=(ok+ng)/2; if(check(mid)>=k) ok=mid; else ng=mid; } print(ok); }