Excel has quietly gained dynamic arrays, XLOOKUP, Power Query, and Python, yet many still work the old way.
auto iter1 = lower_bound(walls.begin(), walls.end(), max(i==0?INT_MIN:r[i-1].first+1, r[i].first-r[i].second)); auto iter2 = upper_bound(walls.begin(), walls.end(), r ...