#include <iostream>
using namespace std;
template<int i_find, int... i_rest>
struct contains;
template<int i_find, int i_head, int... i_rest>
struct contains<i_find, i_head, i_rest...> : contains<i_find, i_rest...> {};
template<int i_find, int... i_rest>
struct contains<i_find, i_find, i_rest...> : std::true_type {};
template<int i_find>
struct contains<i_find> : std::false_type {};
int main() {
printf("contains 0: %i\n", contains<0, 1,2,3,4>() ? 1 : 0);
printf("contains 1: %i\n", contains<1, 1,2,3,4>() ? 1 : 0);
printf("contains 2: %i\n", contains<2, 1,2,3,4>() ? 1 : 0);
printf("contains 3: %i\n", contains<3, 1,2,3,4>() ? 1 : 0);
printf("contains 4: %i\n", contains<4, 1,2,3,4>() ? 1 : 0);
printf("contains 5: %i\n", contains<5, 1,2,3,4>() ? 1 : 0);
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGU8aW50IGlfZmluZCwgaW50Li4uIGlfcmVzdD4Kc3RydWN0IGNvbnRhaW5zOwoKdGVtcGxhdGU8aW50IGlfZmluZCwgaW50IGlfaGVhZCwgaW50Li4uIGlfcmVzdD4Kc3RydWN0IGNvbnRhaW5zPGlfZmluZCwgaV9oZWFkLCBpX3Jlc3QuLi4+IDogY29udGFpbnM8aV9maW5kLCBpX3Jlc3QuLi4+IHt9OwoKdGVtcGxhdGU8aW50IGlfZmluZCwgaW50Li4uIGlfcmVzdD4Kc3RydWN0IGNvbnRhaW5zPGlfZmluZCwgaV9maW5kLCBpX3Jlc3QuLi4+IDogc3RkOjp0cnVlX3R5cGUge307Cgp0ZW1wbGF0ZTxpbnQgaV9maW5kPgpzdHJ1Y3QgY29udGFpbnM8aV9maW5kPiA6IHN0ZDo6ZmFsc2VfdHlwZSB7fTsKCmludCBtYWluKCkgewoJcHJpbnRmKCJjb250YWlucyAwOiAlaVxuIiwgY29udGFpbnM8MCwgMSwyLDMsND4oKSA/IDEgOiAwKTsKCXByaW50ZigiY29udGFpbnMgM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