#include <algorithm>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> input {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
std::partition(input.begin(), input.end(), [](int p){return p % 2 == 0;});
for(int i: input)
std::cout << i << ' ';
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKaW50IG1haW4oKQp7CglzdGQ6OnZlY3RvcjxpbnQ+IGlucHV0IHsxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5LCAwfTsKICAgIHN0ZDo6cGFydGl0aW9uKGlucHV0LmJlZ2luKCksIGlucHV0LmVuZCgpLCBbXShpbnQgcCl7cmV0dXJuIHAgJSAyID09IDA7fSk7CiAgICBmb3IoaW50IGk6IGlucHV0KQogICAgICAgIHN0ZDo6Y291dCA8PCBpIDw8ICcgJzsKfQo=