#include "infection.h"
#include <vector>
#include <utility>
using namespace std;
bool poz[150001];// zarazen
int n,m;
std::vector<int> solve(
    std::vector<std::pair<int, int>> R,
    std::vector<long long> D,
    std::vector<int> s,
    std::vector<int> t,
    std::vector<bool> l
) {//d - 0 s - start t- last i-zarazen?
    n=R.size()+1;m=s.size();//n-vurhove m-hora
    vector<int> ans;
    for(int i=0;i<m;i++){
        if(l[i]) poz[s[i]]=true;
       ans.emplace_back(0);
    }

    for(int i=0;i<m;i++){
        if(poz[s[i]]) ans[i]=(t[i]-s[i]);
    }
    return ans;
}
