template<int I, int... Remainder>
struct sum
{
constexpr static int value = I + sum<Remainder...>::value;
};
template<int I>
struct sum<I>
{
constexpr static int value = I;
};
static_assert(sum<1, 2, 3, 4>::value == 10, "");
int main() {
// your code goes here
return 0;
}
dGVtcGxhdGU8aW50IEksIGludC4uLiBSZW1haW5kZXI+CnN0cnVjdCBzdW0KewoJY29uc3RleHByIHN0YXRpYyBpbnQgdmFsdWUgPSBJICsgc3VtPFJlbWFpbmRlci4uLj46OnZhbHVlOwp9OwoKdGVtcGxhdGU8aW50IEk+CnN0cnVjdCBzdW08ST4KewoJY29uc3RleHByIHN0YXRpYyBpbnQgdmFsdWUgPSBJOwp9OwoKc3RhdGljX2Fzc2VydChzdW08MSwgMiwgMywgND46OnZhbHVlID09IDEwLCAiIik7CgoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglyZXR1cm4gMDsKfQ==