#include using namespace std; #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int INF=1001001001; const int mod = 1000000007; int main() { int N; cin>>N; vectorA(N),B(N); for(int i=0;i>A[i];} for(int i=0;i>B[i];} vector>t(N); for(int i=0;i=sum){r=i;break;} }//cout<