#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int c[] = { 2, 2, 3, 5, 7, 11, 11 };
vector<int> v(c, c + sizeof(c)/sizeof(c[0]));
pair<vector<int>::iterator, vector<int>::iterator>
i = equal_range(v.begin(), v.end(), 11);
cout << "i.first=" << distance(v.begin(), i.first) << endl;
cout << "i.second=" << distance(v.begin(), i.second) << endl;
cout << "v.end()=" << distance(v.begin(), v.end()) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgY1tdID0geyAyLCAyLCAzLCA1LCA3LCAxMSwgMTEgfTsKCXZlY3RvcjxpbnQ+IHYoYywgYyArIHNpemVvZihjKS9zaXplb2YoY1swXSkpOwoJcGFpcjx2ZWN0b3I8aW50Pjo6aXRlcmF0b3IsIHZlY3RvcjxpbnQ+OjppdGVyYXRvcj4gCgkJaSA9IGVxdWFsX3JhbmdlKHYuYmVnaW4oKSwgdi5lbmQoKSwgMTEpOwoJY291dCA8PCAiaS5maXJzdD0iIDw8IGRpc3RhbmNlKHYuYmVnaW4oKSwgaS5maXJzdCkgPDwgZW5kbDsKCWNvdXQgPDwgImkuc2Vjb25kPSIgPDwgZGlzdGFuY2Uodi5iZWdpbigpLCBpLnNlY29uZCkgPDwgZW5kbDsKCWNvdXQgPDwgInYuZW5kKCk9IiA8PCBkaXN0YW5jZSh2LmJlZ2luKCksIHYuZW5kKCkpIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==