#include <iostream>
#include <vector>
template <typename T>
struct range_t
{
T b, e;
range_t(T x, T y) : b(x), e(y) {}
T begin()
{
return b;
}
T end()
{
return e;
}
};
template <typename T>
range_t<T> range(T b, T e)
{
return range_t<T>(b, e);
}
int main()
{
std::vector<int> v{ 1, 2, 3, 4 };
for (auto p : range(v.begin()+1, v.end()))
{
std::cout << p << " ";
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+CnN0cnVjdCByYW5nZV90CnsKICAgIFQgYiwgZTsKICAgIHJhbmdlX3QoVCB4LCBUIHkpIDogYih4KSwgZSh5KSB7fQogICAgVCBiZWdpbigpCiAgICB7CiAgICAgICAgcmV0dXJuIGI7CiAgICB9CiAgICBUIGVuZCgpCiAgICB7CiAgICAgICAgcmV0dXJuIGU7CiAgICB9Cn07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KcmFuZ2VfdDxUPiByYW5nZShUIGIsIFQgZSkKewoJcmV0dXJuIHJhbmdlX3Q8VD4oYiwgZSk7Cn0KCmludCBtYWluKCkKewogICAgc3RkOjp2ZWN0b3I8aW50PiB2eyAxLCAyLCAzLCA0IH07CgogICAgZm9yIChhdXRvIHAgOiByYW5nZSh2LmJlZ2luKCkrMSwgdi5lbmQoKSkpCiAgICB7CiAgICAgICAgc3RkOjpjb3V0IDw8IHAgPDwgIiAiOwogICAgfQp9Cg==