#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int
Mul (int &_Left)
{
if (_Left <= 3)
return 2 * _Left;
else
return 6;
}
int
main ()
{
int mynumbers[] = { 8, 9, 7, 2, 4, 1 };
vector < int >v1 (mynumbers, mynumbers + 6);
vector < int >v2 (7);
transform (v1.begin (), v1.end (), v2.begin (), ptr_fun (Mul)); //LINE I
vector < int >::iterator it = find_if (v2.begin (), v2.end (), bind2nd (equal_to < int >(), 4)); // LINE II
cout << *it << endl; // LINE III
return 0;
}
I2luY2x1ZGUgPHZlY3Rvcj4KCiNpbmNsdWRlIDxpb3N0cmVhbT4KCiNpbmNsdWRlIDxhbGdvcml0aG0+CgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQKTXVsIChpbnQgJl9MZWZ0KQp7CgogIGlmIChfTGVmdCA8PSAzKQoKICAgIHJldHVybiAyICogX0xlZnQ7CgogIGVsc2UKCiAgICByZXR1cm4gNjsKCn0KCmludAptYWluICgpCnsKCiAgaW50IG15bnVtYmVyc1tdID0geyA4LCA5LCA3LCAyLCA0LCAxIH07CgogIHZlY3RvciA8IGludCA+djEgKG15bnVtYmVycywgbXludW1iZXJzICsgNik7CgogIHZlY3RvciA8IGludCA+djIgKDcpOwoKICB0cmFuc2Zvcm0gKHYxLmJlZ2luICgpLCB2MS5lbmQgKCksIHYyLmJlZ2luICgpLCBwdHJfZnVuIChNdWwpKTsgICAgLy9MSU5FIEkKCiAgdmVjdG9yIDwgaW50ID46Oml0ZXJhdG9yIGl0ID0gZmluZF9pZiAodjIuYmVnaW4gKCksIHYyLmVuZCAoKSwgYmluZDJuZCAoZXF1YWxfdG8gPCBpbnQgPigpLCA0KSk7ICAgIC8vIExJTkUgSUkKCiAgY291dCA8PCAqaXQgPDwgZW5kbDsgICAgICAgIC8vIExJTkUgSUlJCgogIHJldHVybiAwOwoKfQo=