#include <iostream>
#include <vector>
std::ostream& operator<<(std::ostream& os, const std::vector<int>& v)
{
os << '{';
if (v.empty())
os << " empty";
else
{
for (auto e : v)
os << ' ' << e;
}
return os << " }";
}
std::ostream& operator<<(std::ostream& os, const std::vector<std::vector<int>>& v)
{
for (auto e : v)
os << e << '\n';
return os;
}
int main()
{
std::vector<std::vector<int>> row{ { 1 }, { 2 }, { 3 }, { 4 } };
std::cout << row << '\n';
row[0].erase(row[0].begin());
std::cout << row << '\n';
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKc3RkOjpvc3RyZWFtJiBvcGVyYXRvcjw8KHN0ZDo6b3N0cmVhbSYgb3MsIGNvbnN0IHN0ZDo6dmVjdG9yPGludD4mIHYpCnsKICAgIG9zIDw8ICd7JzsKCiAgICBpZiAodi5lbXB0eSgpKQogICAgICAgIG9zIDw8ICIgZW1wdHkiOwogICAgZWxzZQogICAgewogICAgICAgIGZvciAoYXV0byBlIDogdikKICAgICAgICAgICAgb3MgPDwgJyAnIDw8IGU7CiAgICB9CgogICAgcmV0dXJuIG9zIDw8ICIgfSI7Cn0KCnN0ZDo6b3N0cmVhbSYgb3BlcmF0b3I8PChzdGQ6Om9zdHJlYW0mIG9zLCBjb25zdCBzdGQ6OnZlY3RvcjxzdGQ6OnZlY3RvcjxpbnQ+PiYgdikKewogICAgZm9yIChhdXRvIGUgOiB2KQogICAgICAgIG9zIDw8IGUgPDwgJ1xuJzsKCiAgICByZXR1cm4gb3M7Cn0KCmludCBtYWluKCkKewogICAgc3RkOjp2ZWN0b3I8c3RkOjp2ZWN0b3I8aW50Pj4gcm93eyB7IDEgfSwgeyAyIH0sIHsgMyB9LCB7IDQgfSB9OwoKICAgIHN0ZDo6Y291dCA8PCByb3cgPDwgJ1xuJzsKCiAgICByb3dbMF0uZXJhc2Uocm93WzBdLmJlZ2luKCkpOwoKICAgIHN0ZDo6Y291dCA8PCByb3cgPDwgJ1xuJzsKfQ==