#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
int main() {
const vector<pair<int, int>> intervals = { { 1, 3 },{ 7, 9 },{ 13, 13 } };
std::vector<double> values = { 4.2, 6.4, 2.3, 3.4, 9.1, 2.3, 0.6, 1.2, 0.3, 0.4, 6.4, 3.6, 1.4, 2.5, 7.5 };
size_t write = 0U;
auto it = cbegin(intervals);
values.resize(distance(begin(values), remove_if(begin(values), end(values), [i = 0U, it = cbegin(intervals), end = cend(intervals)](const auto&) mutable { return it != end && ++i > it->first && (i <= it->second || (++it, true)); })));
/*for (size_t read = 0U; read < size(values); ++read) {
if (it == cend(intervals) || read < it->first) {
values[write++] = values[read];
} else if (read == it->second) {
++it;
}
}
values.resize(write);*/
for (const auto& i : values) cout << i << ' ';
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dXRpbGl0eT4KI2luY2x1ZGUgPHZlY3Rvcj4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWNvbnN0IHZlY3RvcjxwYWlyPGludCwgaW50Pj4gaW50ZXJ2YWxzID0geyB7IDEsIDMgfSx7IDcsIDkgfSx7IDEzLCAxMyB9IH07CglzdGQ6OnZlY3Rvcjxkb3VibGU+IHZhbHVlcyA9IHsgNC4yLCA2LjQsIDIuMywgMy40LCA5LjEsIDIuMywgMC42LCAxLjIsIDAuMywgMC40LCA2LjQsIDMuNiwgMS40LCAyLjUsIDcuNSB9OwoJc2l6ZV90IHdyaXRlID0gMFU7CglhdXRvIGl0ID0gY2JlZ2luKGludGVydmFscyk7CgoJdmFsdWVzLnJlc2l6ZShkaXN0YW5jZShiZWdpbih2YWx1ZXMpLCByZW1vdmVfaWYoYmVnaW4odmFsdWVzKSwgZW5kKHZhbHVlcyksIFtpID0gMFUsIGl0ID0gY2JlZ2luKGludGVydmFscyksIGVuZCA9IGNlbmQoaW50ZXJ2YWxzKV0oY29uc3Q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