#include <map>
#include<iostream>
using namespace std;
int main() {
multimap<int,string> m;
m.insert({1,"hello"});
m.insert({1,"world"});
m.insert({2,"goodbye"});
m.insert({3,"spacecows"});
cout<<"Number of elements in key 1: "<<m.count(1)<<endl;
auto range = m.equal_range(1);
for(auto iter = range.first; iter != range.second; iter++) cout<<iter->second<<" ";
cout<<endl;
return 0;
}
I2luY2x1ZGUgPG1hcD4KI2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKCmludCBtYWluKCkgewoJbXVsdGltYXA8aW50LHN0cmluZz4gbTsKCW0uaW5zZXJ0KHsxLCJoZWxsbyJ9KTsKCW0uaW5zZXJ0KHsxLCJ3b3JsZCJ9KTsKCW0uaW5zZXJ0KHsyLCJnb29kYnllIn0pOwoJbS5pbnNlcnQoezMsInNwYWNlY293cyJ9KTsKCQoJY291dDw8Ik51bWJlciBvZiBlbGVtZW50cyBpbiBrZXkgMTogIjw8bS5jb3VudCgxKTw8ZW5kbDsKCQoJYXV0byByYW5nZSA9IG0uZXF1YWxfcmFuZ2UoMSk7Cglmb3IoYXV0byBpdGVyID0gcmFuZ2UuZmlyc3Q7IGl0ZXIgIT0gcmFuZ2Uuc2Vjb25kOyBpdGVyKyspIGNvdXQ8PGl0ZXItPnNlY29uZDw8IiAiOwoJY291dDw8ZW5kbDsKCXJldHVybiAwOwp9