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

std::vector<int> solve(vector<pair<int, int>> R,vector<long long> D,vector<int> S,vector<int> T,vector<bool> I){
    int n = (int) R.size() + 1;
    int m = (int) I.size();
    vector<bool> isActive(n, false);
    for(int i =0;i<n;++i)
        if(I[i]) isActive[S[i]]=true;
    vector<int> ans(m, 0);
    for(int i =0;i<m;++i){
        if(!isActive[S[i]])continue;
        ans[i] = T[i]-S[i]+1;
    }
    return ans;
}

int main(){
    // vector<pair<int,int> > s = {{0,1},{1,2},{2,3}};
    // vector<ll> b ={0,0};
    // vector<int> c = {0,1};
    // vector<int> d= {3, 2};
    // vector<bool> i = {1, 0};
    // for(int a : solve(s,b,c,d,i)){
    //     printf("%d s", a);
    // }
    return 0;
}