#include using namespace std; #define ll long long #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define Pr pair #define Tp tuple using Graph = vector>; ll mod = 1000000007; //mod逆元 long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } //Combination2 //10^6くらいまで //modはグローバルに定義しておく vector fact; vector invf; ll comb(ll n,ll k){ if(n<0||k<0||k>n) return 0LL; else{ ll a = fact[n]*invf[k]%mod; a = a*invf[n-k]%mod; return a; } } /* //main関数内に以下ペースト //N:max fact.assign(2*N+1,1LL); invf.assign(2*N+1,1LL); rep(i,2*N) fact[i+1] = fact[i]*(i+1)%mod; rep(i,2*N+1) invf[i] = modinv(fact[i],mod); */ int main() { ll N,K,P; cin >> N >> K >> P; ll a[N]; vector b; rep(i,N) cin >> a[i]; rep(i,N){ ll d; cin >> d; b.push_back(d); } sort(b.begin(),b.end()); //解から二分探索 binary search //分かれ目の"r"側の値を求める ll l,r,ans; l = 0; r = P; //初期値の代入 while(l