#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

long long Resi(int N, int *A, int *B)
{
    return 0;
    /*
    if(N==1){
        return 0;
    }
    else if(N==2){
        return 0;
    }

    deque<ll> dq;
    dq.push_back(B[0]);
    dq.push_back(B[1]);

    for(int i=2;i<=N;i++){
        while(bio[dq.front()]==1){
            dq.pop_front();
        }
        while(bio[pq.back()]==1){
            dq.pop_back();
        }

        if(dq.front()>dq.back()){
            dq.
        }

    }
    */

}