#include <iostream>
#include <vector>
#include <random>
#include <algorithm>
int main(){
std::random_device rd;
std::mt19937 mt(rd());
std::vector<int> Vec;
int V = 0;
Vec.resize(16);
for (auto& i : Vec) i = V++;
std::shuffle(Vec.begin(), Vec.end(), mt);
for (auto& i : Vec) std::cout << i << ' ';
std::cout << std::endl;
for (std::size_t i = 0; i < Vec.size(); i++){//バブルソート。sort_ifがほしいところだな。
if (Vec[i] % 2 == 0) continue;
for (std::size_t j = 0; j < Vec.size(); j++){
if (Vec[j] % 2 == 0) continue;
if (Vec[i]<Vec[j]) std::swap(Vec[i], Vec[j]);
}
}
for (auto& i : Vec) std::cout << i << ' ';
std::cout << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8cmFuZG9tPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKaW50IG1haW4oKXsKCglzdGQ6OnJhbmRvbV9kZXZpY2UgcmQ7CglzdGQ6Om10MTk5MzcgbXQocmQoKSk7CglzdGQ6OnZlY3RvcjxpbnQ+IFZlYzsKCWludCBWID0gMDsKCVZlYy5yZXNpemUoMTYpOwoJZm9yIChhdXRvJiBpIDogVmVjKSBpID0gVisrOwoJc3RkOjpzaHVmZmxlKFZlYy5iZWdpbigpLCBWZWMuZW5kKCksIG10KTsKCWZvciAoYXV0byYgaSA6IFZlYykgc3RkOjpjb3V0IDw8IGkgPDwgJyAnOwoJc3RkOjpjb3V0IDw8IHN0ZDo6ZW5kbDsKCglmb3IgKHN0ZDo6c2l6ZV90IGkgPSAwOyBpIDwgVmVjLnNpemUoKTsgaSsrKXsvL+ODkOODluODq+OCveODvOODiOOAgnNvcnRfaWbjgYzjgbvjgZfjgYTjgajjgZPjgo3jgaDjgarjgIIKCQlpZiAoVmVjW2ldICUgMiA9PSAwKSBjb250aW51ZTsKCQlmb3IgKHN0ZDo6c2l6ZV90IGogPSAwOyBqIDwgVmVjLnNpemUoKTsgaisrKXsKCQkJaWYgKFZlY1tqXSAlIDIgPT0gMCkgY29udGludWU7CgkJCWlmIChWZWNbaV08VmVjW2pdKSBzdGQ6OnN3YXAoVmVjW2ldLCBWZWNbal0pOwoJCX0KCX0KCWZvciAoYXV0byYgaSA6IFZlYykgc3RkOjpjb3V0IDw8IGkgPDwgJyAnOwoJc3RkOjpjb3V0IDw8IHN0ZDo6ZW5kbDsKCXJldHVybiAwOwp9