vector<int> s = {1,2,3,4,4,4,5,6} int l = *lower_bound(s.begin(),s.end(),4); int r = *upper_bound(s.begin(),s.end(),4); cout << l << " " << r << "\n"; // cout -> 3 6