#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]));
auto 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+IHYoYywgYyArIHNpemVvZihjKS9zaXplb2YoY1swXSkpOwoJYXV0byBpID0gZXF1YWxfcmFuZ2Uodi5iZWdpbigpLCB2LmVuZCgpLCAxMSk7Cgljb3V0IDw8ICJpLmZpcnN0PSIgPDwgZGlzdGFuY2Uodi5iZWdpbigpLCBpLmZpcnN0KSA8PCBlbmRsOwoJY291dCA8PCAiaS5zZWNvbmQ9IiA8PCBkaXN0YW5jZSh2LmJlZ2luKCksIGkuc2Vjb25kKSA8PCBlbmRsOwoJY291dCA8PCAidi5lbmQoKT0iIDw8IGRpc3RhbmNlKHYuYmVnaW4oKSwgdi5lbmQoKSkgPDwgZW5kbDsKCXJldHVybiAwOwp9