#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <numeric>
using namespace std;
template<class T>
class Print{
public:
void operator()(T& t){
cout << t << " ";
}
};
int main(){
int ary[5];
fill(ary, ary + 5, 1);
vector<int> v(5);
vector<int>::iterator it;
Print<int> print;
iota(v.begin(),v.end(),1);
cout << "Vector v :" << endl;
for_each(v.begin(),v.end(), print);
cout << endl;
it = v.begin();
cout << "v.insert(it,10)" << endl;
v.insert(it, 10);
for_each(v.begin(), v.end(), print);
cout << endl;
it = v.begin()+5;
cout << "v.insert(it,ary+2,ary+5)" << endl;
v.insert(it, ary + 2, ary + 5);
for_each(v.begin(), v.end(), print);
cout << endl;
it = v.end() - 2;
cout << "v.insert(it,2,20)";
v.insert(it, 2, 20);
for_each(v.begin(),v.end(),print);
cout << endl;
return 0;
}