#include <algorithm>
#include <random>
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <iomanip>
int main()
{
constexpr std::size_t N = 6 ;
int a[N][N] ;
auto begin = std::begin( a[0] ) ;
auto end = std::end( a[N-1] ) ;
std::iota( begin, end, 1 ) ;
std::srand( std::time(nullptr) ) ;
std::seed_seq seed_seq { std::rand(), std::rand(), std::rand(), std::rand() } ;
std::shuffle( begin, end, std::mt19937(seed_seq) ) ;
for( const auto& row : a )
{
for( int i : row ) std::cout << std::setw(3) << i ;
std::cout << '\n' ;
}
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPHJhbmRvbT4KI2luY2x1ZGUgPGN0aW1lPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KCmludCBtYWluKCkKewogICAgY29uc3RleHByIHN0ZDo6c2l6ZV90IE4gPSA2IDsKICAgIGludCBhW05dW05dIDsKICAgIGF1dG8gYmVnaW4gPSBzdGQ6OmJlZ2luKCBhWzBdICkgOwogICAgYXV0byBlbmQgPSBzdGQ6OmVuZCggYVtOLTFdICkgOwoKICAgIHN0ZDo6aW90YSggYmVnaW4sIGVuZCwgMSApIDsKICAgIHN0ZDo6c3JhbmQoIHN0ZDo6dGltZShudWxscHRyKSApIDsKICAgIHN0ZDo6c2VlZF9zZXEgc2VlZF9zZXEgeyBzdGQ6OnJhbmQoKSwgc3RkOjpyYW5kKCksIHN0ZDo6cmFuZCgpLCBzdGQ6OnJhbmQoKSB9IDsKICAgIHN0ZDo6c2h1ZmZsZSggYmVnaW4sIGVuZCwgc3RkOjptdDE5OTM3KHNlZWRfc2VxKSApIDsKCiAgICBmb3IoIGNvbnN0IGF1dG8mIHJvdyA6IGEgKQogICAgewogICAgICAgIGZvciggaW50IGkgOiByb3cgKSBzdGQ6OmNvdXQgPDwgc3RkOjpzZXR3KDMpIDw8IGkgOwogICAgICAgIHN0ZDo6Y291dCA8PCAnXG4nIDsKICAgIH0KfQo=