#include <iostream>
#include <vector>
template <typename T>
std::ostream& operator<< (std::ostream& out, const std::vector<T>& v) {
if (!v.empty()) {
auto it = v.begin();;
for (; it != v.end() - 1; ++it)
{
out << *it << ", ";
}
out << *it << std::endl;
}
return out;
}
int main()
{
std::vector<int> v{ 1, 2, 3, 4 };
std::cout << v;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpzdGQ6Om9zdHJlYW0mIG9wZXJhdG9yPDwgKHN0ZDo6b3N0cmVhbSYgb3V0LCBjb25zdCBzdGQ6OnZlY3RvcjxUPiYgdikgewoJaWYgKCF2LmVtcHR5KCkpIHsKCQlhdXRvIGl0ID0gdi5iZWdpbigpOzsKCQlmb3IgKDsgaXQgIT0gdi5lbmQoKSAtIDE7ICsraXQpCgkJewoJCQlvdXQgPDwgKml0IDw8ICIsICI7CgkJfQoJCW91dCA8PCAqaXQgPDwgc3RkOjplbmRsOwoJfQoJcmV0dXJuIG91dDsKfQoKaW50IG1haW4oKQp7CglzdGQ6OnZlY3RvcjxpbnQ+IHZ7IDEsIDIsIDMsIDQgfTsKCQoJc3RkOjpjb3V0IDw8IHY7CgoJcmV0dXJuIDA7Cn0=