#include <iostream>
#include <iomanip>
#include <list>
#include <vector>
template < typename SEQUENCE_2D >
void print_seq2d( const SEQUENCE_2D& a, int width = 2 )
{
for( const auto& row : a )
{
for( const auto& v : row ) std::cout << std::setw(width) << v ;
std::cout << '\n' ;
}
std::cout << "------------\n" ;
}
int main()
{
int a[][3] = { { 1, 2, 3 }, { 3, 4, 5 }, { 5, 6, 7 }, { 8, 9, 1 } } ;
short b[][4] = { { 35, 16, 7, 8 } , { 3, 29, 2, 42 }, { 21, 32, 43, 54 } } ;
std::list< std::vector<long> > c = { { 1, 2, 3 }, { 3, 4 }, { 5 }, { 6, 7 }, { 5, 6, 7, 8 } } ;
print_seq2d(a) ;
print_seq2d( b, 3 ) ;
print_seq2d(c) ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDx2ZWN0b3I+Cgp0ZW1wbGF0ZSA8IHR5cGVuYW1lIFNFUVVFTkNFXzJEID4Kdm9pZCBwcmludF9zZXEyZCggY29uc3QgU0VRVUVOQ0VfMkQmIGEsIGludCB3aWR0aCA9IDIgKQp7CiAgICBmb3IoIGNvbnN0IGF1dG8mIHJvdyA6IGEgKQogICAgewogICAgICAgIGZvciggY29uc3QgYXV0byYgdiA6IHJvdyApIHN0ZDo6Y291dCA8PCBzdGQ6OnNldHcod2lkdGgpIDw8IHYgIDsKICAgICAgICBzdGQ6OmNvdXQgPDwgJ1xuJyA7CiAgICB9CiAgICBzdGQ6OmNvdXQgPDwgIi0tLS0tLS0tLS0tLVxuIiA7Cn0KCmludCBtYWluKCkKewogICAgaW50IGFbXVszXSA9IHsgeyAxLCAyLCAzIH0sIHsgMywgNCwgNSB9LCB7IDUsIDYsIDcgfSwgeyA4LCA5LCAxIH0gfSA7CiAgICBzaG9ydCBiW11bNF0gPSB7IHsgMzUsIDE2LCA3LCA4IH0gLCB7IDMsIDI5LCAyLCA0MiB9LCB7IDIxLCAz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