#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <ctime>
using namespace std;
template <typename T>
void _print(const T& i)
{
cout<<i<<endl;
}
template <>
void _print<bool>(const bool& i)
{
if (i == 0)
cout<<"False"<<endl;
else
cout<<"True"<<endl;
}
void _print(const vector<bool>::reference& i)
{
_print<bool>(i);
}
class print
{
public:
template <typename T>
void operator()(const T& val) const { _print(val); };
};
int main()
{
auto even = [&](int i)->bool{return (i%2==0);};
srand(time(NULL));
vector <int> test(3);
generate(test.begin(),test.end(),[]()->int{return rand()%100;});
for_each(test.begin(),test.end(),print());
vector <bool> flag(3);
transform(test.begin(),test.end(),flag.begin(),even);
for_each(flag.begin(),flag.end(),print());
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8bnVtZXJpYz4KI2luY2x1ZGUgPGN0aW1lPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgp2b2lkIF9wcmludChjb25zdCBUJiBpKQp7CiAgICBjb3V0PDxpPDxlbmRsOwp9CnRlbXBsYXRlIDw+CnZvaWQgX3ByaW50PGJvb2w+KGNvbnN0IGJvb2wmIGkpCnsKICAgIGlmIChpID09IDApCiAgICAgICAgY291dDw8IkZhbHNlIjw8ZW5kbDsKICAgIGVsc2UKICAgICAgICBjb3V0PDwiVHJ1ZSI8PGVuZGw7Cn0KCnZvaWQgX3ByaW50KGNvbnN0IHZlY3Rvcjxib29sPjo6cmVmZXJlbmNlJiBpKQp7CiAgICBfcHJpbnQ8Ym9vbD4oaSk7Cn0KCmNsYXNzIHByaW50CnsKcHVibGljOgoKICB0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KICB2b2lkIG9wZXJhdG9yKCkoY29uc3QgVCYgdmFsKSBjb25zdCB7IF9wcmludCh2YWwpOyB9Owp9OwoKCmludCBtYWluKCkKewogIGF1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