William has two arrays aa and bb, each consisting of nn items. For some segments l..rl..r of these arrays William wants to know if it is possible to equalize the values of items in these segments using a balancing operation. Formally, the values are equalized if for each ii from ll to rr holds ai=biai=bi. Equilibrium solution codeforces To perform a balancing operation an even number of indices must be selected, such that l≤pos1 100% correct solution

William has two arrays aa and bb, each consisting of nn items. For some segments l..rl..r of these arrays William wants to know if it is possible to equalize the values of items in these segments using a balancing operation. Formally, the values are equalized if for each ii from ll to rr holds ai=biai=bi. Equilibrium solution codeforces To perform a balancing operation an even number of indices must … Read more