#include <iostream>
#include <algorithm>
#include <iterator>
template <typename T, typename... Args>
bool allequal(T a, Args... rest)
{
std::initializer_list<T> values = {a, rest...};
return std::adjacent_find(begin(values), end(values), std::not_equal_to<T>()) == end(values);
}
int main()
{
std::cout << allequal(3, 2, 3, 3);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8aXRlcmF0b3I+Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVCwgdHlwZW5hbWUuLi4gQXJncz4KYm9vbCBhbGxlcXVhbChUIGEsIEFyZ3MuLi4gcmVzdCkKewogICAgc3RkOjppbml0aWFsaXplcl9saXN0PFQ+IHZhbHVlcyA9IHthLCByZXN0Li4ufTsKICAgIHJldHVybiBzdGQ6OmFkamFjZW50X2ZpbmQoYmVnaW4odmFsdWVzKSwgZW5kKHZhbHVlcyksIHN0ZDo6bm90X2VxdWFsX3RvPFQ+KCkpID09IGVuZCh2YWx1ZXMpOwp9CgppbnQgbWFpbigpCnsKCXN0ZDo6Y291dCA8PCBhbGxlcXVhbCgzLCAyLCAzLCAzKTsKfQ==