#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
// 0 1 2 3 4 5 6 7 8 9
vector<int> arr = { 1, 2, 2, 3, 3, 3, 4, 4, 4, 4 };
cout << lower_bound(arr.begin(), arr.end(), 3) - arr.begin() << endl; // 3
cout << upper_bound(arr.begin(), arr.end(), 3) - arr.begin() << endl; // 6
return 0;
}