Use limite inferior no vetor de pares
int position = lower_bound(v.begin(),v.end(),{first, -inf})-v.begin();
Bright Batfish
int position = lower_bound(v.begin(),v.end(),{first, -inf})-v.begin();