#include <iostream>
#include <vector>
#include <algorithm>
int main(){
std::vector<int> al{ 0, 1, 2, 3, 4, };
std::vector<int> ar{ 5, 6, 7, 8, 9, };
std::vector<std::vector<int>> k(5);
for (std::size_t i = 0; i < 5; i++)
{
for (std::size_t j = 0; j < 5; j++)
{
k[j].push_back(al[j]);
k[j].push_back(ar[j]);
}
std::rotate(al.begin(), al.begin() + 1, al.end());
std::rotate(ar.rbegin(), ar.rbegin() + 1, ar.rend());
}
for (auto& oo : k){
for (auto& o : oo){
std::cout << o;
}
std::cout << std::endl;
}
std::cout << "5Count!!" << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKaW50IG1haW4oKXsKCglzdGQ6OnZlY3RvcjxpbnQ+IGFseyAwLCAxLCAyLCAzLCA0LCB9OwoJc3RkOjp2ZWN0b3I8aW50PiBhcnsgNSwgNiwgNywgOCwgOSwgfTsKCXN0ZDo6dmVjdG9yPHN0ZDo6dmVjdG9yPGludD4+IGsoNSk7CgoJZm9yIChzdGQ6OnNpemVfdCBpID0gMDsgaSA8IDU7IGkrKykKCXsKCQlmb3IgKHN0ZDo6c2l6ZV90IGogPSAwOyBqIDwgNTsgaisrKQoJCXsKCQkJa1tqXS5wdXNoX2JhY2soYWxbal0pOwoJCQlrW2pdLnB1c2hfYmFjayhhcltqXSk7CgoJCX0KCQlzdGQ6OnJvdGF0ZShhbC5iZWdpbigpLCBhbC5iZWdpbigpICsgMSwgYWwuZW5kKCkpOwoJCXN0ZDo6cm90YXRlKGFyLnJiZWdpbigpLCBhci5yYmVnaW4oKSArIDEsIGFyLnJlbmQoKSk7Cgl9CgoJZm9yIChhdXRvJiBvbyA6IGspewoJCWZvciAoYXV0byYgbyA6IG9vKXsKCQkJc3RkOjpjb3V0IDw8IG87CgkJfQoJCXN0ZDo6Y291dCA8PCBzdGQ6OmVuZGw7Cgl9CglzdGQ6OmNvdXQgPDwgIjVDb3VudCEhIiA8PCBzdGQ6OmVuZGw7CgoJcmV0dXJuIDA7Cn0=