#include <iostream>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> ordered_multiset;
int main() {
ordered_multiset ms;
vector<int> v{1, 1, 2, 2, 3, 4, 5, 6, 6};
for(int i : v) ms.insert(i);
cout << "Ordered Multiset: ";
for(auto x : ms) cout << x << ' '; cout << '\n';
cout << "Lower bound of 2: " << *ms.lower_bound(2) << '\n';
cout << "Upper bound of 2: " << *ms.upper_bound(2) << '\n';
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KI2luY2x1ZGU8ZXh0L3BiX2RzL3RyZWVfcG9saWN5LmhwcD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnVzaW5nIG5hbWVzcGFjZSBfX2dudV9wYmRzOwp0eXBlZGVmIHRyZWU8aW50LCBudWxsX3R5cGUsIGxlc3M8aW50PiwgcmJfdHJlZV90YWcsIAogICAgICAgICAgICAgdHJlZV9vcmRlcl9zdGF0aXN0aWNzX25vZGVfdXBkYXRlPiBvcmRlcmVkX211bHRpc2V0OwoKaW50IG1haW4oKSB7CglvcmRlcmVkX211bHRpc2V0IG1zOwogICAgdmVjdG9yPGludD4gdnsxLCAxLCAyLCAyLCAzLCA0LCA1LCA2LCA2fTsKCiAgICBmb3IoaW50IGkgOiB2KSBtcy5pbnNlcnQoaSk7CgoJY291dCA8PCAiT3JkZXJlZCBNdWx0aXNldDogIjsKICAgIGZvcihhdXRvIHggOiBtcykgY291dCA8PCB4IDw8ICcgJzsgY291dCA8PCAnXG4nOwoKICAgIGNvdXQgPDwgIkxvd2VyIGJvdW5kIG9mIDI6ICIgPDwgKm1zLmxvd2VyX2JvdW5kKDIpIDw8ICdcbic7CiAgICBjb3V0IDw8ICJVcHBlciBib3VuZCBvZiAyOiAiIDw8ICptcy51cHBlcl9ib3VuZCgyKSA8PCAnXG4nOwogICAgcmV0dXJuIDA7Cn0=