#include <iostream>
#include <set>
#define st std::set<int>
st union_(const std::set<int> &s, const std::set<int> &t);
int main() {
st a{5, 7, 3, 9, 10, 3},
b{10, 5, 12, 49, 0};
std::set<int> c = union_(a, b);
// std::cout << item << " ";
for(auto& item:c) std::cout << item << " ";
}
st union_(const std::set<int> &s, const std::set<int> &t) {
st res(t);
return res;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c2V0PgojZGVmaW5lIHN0IHN0ZDo6c2V0PGludD4KCnN0IHVuaW9uXyhjb25zdCBzdGQ6OnNldDxpbnQ+ICZzLCBjb25zdCBzdGQ6OnNldDxpbnQ+ICZ0KTsKCmludCBtYWluKCkgewoJc3QJYXs1LCA3LCAzLCA5LCAxMCwgM30sCgkJYnsxMCwgNSwgMTIsIDQ5LCAwfTsKCXN0ZDo6c2V0PGludD4gYyA9IHVuaW9uXyhhLCBiKTsKCS8vIHN0ZDo6Y291dCA8PCBpdGVtIDw8ICIgIjsKCWZvcihhdXRvJiBpdGVtOmMpIHN0ZDo6Y291dCA8PCBpdGVtIDw8ICIgIjsKCQp9CgogICAgc3QgdW5pb25fKGNvbnN0IHN0ZDo6c2V0PGludD4gJnMsIGNvbnN0IHN0ZDo6c2V0PGludD4gJnQpIHsKICAgIHN0IHJlcyh0KTsKICAgIHJldHVybiByZXM7CiB9