#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector <int> myVec = { 5, 12, 521, 9 };
for ( auto it : myVec )
cout << it << endl;
for_each( begin(myVec), end(myVec), [&](const int & ref){
cout << 2*ref << endl;
});
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAppbnQgbWFpbigpCnsKICAgIHZlY3RvciA8aW50PiBteVZlYyA9IHsgNSwgMTIsIDUyMSwgOSB9OwogICAgCiAgICBmb3IgKCBhdXRvIGl0IDogbXlWZWMgKQogICAgIGNvdXQgPDwgaXQgPDwgZW5kbDsKICAgICAKICAgIGZvcl9lYWNoKCBiZWdpbihteVZlYyksIGVuZChteVZlYyksIFsmXShjb25zdCBpbnQgJiByZWYpewogICAgCWNvdXQgPDwgMipyZWYgPDwgZW5kbDsKICAgIH0pOwogICAgCiAgICByZXR1cm4gMDsKfQ==