#include <iostream>
#include <vector>
#include <iterator>
#include <cstddef>
template <typename T>
struct skip
{
T& t;
std::size_t n;
skip(T& v, std::size_t s) : t(v), n(s) {}
auto begin() -> decltype(std::begin(t))
{
return std::next(std::begin(t), n);
}
auto end() -> decltype(std::end(t))
{
return std::end(t);
}
};
int main()
{
std::vector<int> v{ 1, 2, 3, 4 };
for (auto p : skip<decltype(v)>(v, 1))
{
std::cout << p << " ";
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxjc3RkZGVmPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+CnN0cnVjdCBza2lwCnsKICAgIFQmIHQ7CiAgICBzdGQ6OnNpemVfdCBuOwogICAgc2tpcChUJiB2LCBzdGQ6OnNpemVfdCBzKSA6IHQodiksIG4ocykge30KICAgIGF1dG8gYmVnaW4oKSAtPiBkZWNsdHlwZShzdGQ6OmJlZ2luKHQpKQogICAgewogICAgICAgIHJldHVybiBzdGQ6Om5leHQoc3RkOjpiZWdpbih0KSwgbik7CiAgICB9CiAgICBhdXRvIGVuZCgpIC0+IGRlY2x0eXBlKHN0ZDo6ZW5kKHQpKQogICAgewogICAgICAgIHJldHVybiBzdGQ6OmVuZCh0KTsKICAgIH0KfTsKCmludCBtYWluKCkKewogICAgc3RkOjp2ZWN0b3I8aW50PiB2eyAxLCAyLCAzLCA0IH07CgogICAgZm9yIChhdXRvIHAgOiBza2lwPGRlY2x0eXBlKHYpPih2LCAxKSkKICAgIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgcCA8PCAiICI7CiAgICB9Cn0K