#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MOD (long long int)(1e9+7) #define ll long long int #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=1; i<=(int)(n); i++) #define REP(i,n) for(int i=n-1; i>=0; i--) #define REPS(i,n) for(int i=n; i>0; i--) #define INF (int)(1123456789) #define LINF (long long int)(112345678901234567) //struct position{int x;}; int main(void){ int n,x,y; ll l; cin>>n>>l; //vector P; vector sushi,tea; rep(i,n){ cin>>x; sushi.push_back(x); } rep(i,n){ cin>>y; tea.push_back(y); } sushi.push_back(1000000009); tea.push_back(1000000009); vector atode; int sc=0,tc=0; int count=0,ans=0,ansp; int si=0,ti=0; while(si 0){ if(ans <= sc){ ans = sc; ansp = tea[ti]; } sc--; }else{ atode.push_back(ti%n); } ti++; } //cout< sushi2,tea2; cout<<"hogea"< 0){ if(ans <= sc){ ans = sc; if(ansp > tea2[ti]){ ansp = tea2[ti]; } } sc--; }else{ } ti=(ti+1)%n; } cout<