#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
const int SIZE = 10;
int a1[] = { 2, 2, 4, 4, 4, 6, 6, 6, 6, 8 };
vector< int > v( a1, a1 + SIZE );
vector< int >::iterator upper;
upper = upper_bound( v.begin(), v.end(), 6 );
cout << "\nUpper bound of 6 is element " << ( upper - v.begin() ) << " of vector v";
return 0;
}