#include <iostream>
template<typename T>
T sum(T v)
{
return v;
}
template<typename T, typename... Args>
T sum(T first, Args... args)
{
return first + sum(args...);
}
int main()
{
long lsum = sum(1, 2, 3, 4, 5);
std::string s1 = "He", s2 = "llo ", s3 = "Wor", s4 = "ld";
std::string ssum = sum(s1, s2, s3, s4);
std::cout << lsum << std::endl
<< ssum << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGU8dHlwZW5hbWUgVD4KVCBzdW0oVCB2KQp7CiAgcmV0dXJuIHY7Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIFQsIHR5cGVuYW1lLi4uIEFyZ3M+ClQgc3VtKFQgZmlyc3QsIEFyZ3MuLi4gYXJncykKewogIHJldHVybiBmaXJzdCArIHN1bShhcmdzLi4uKTsKfQoKaW50IG1haW4oKQp7CiAgbG9uZyBsc3VtID0gc3VtKDEsIDIsIDMsIDQsIDUpOwoKICBzdGQ6OnN0cmluZyBzMSA9ICJIZSIsIHMyID0gImxsbyAiLCBzMyA9ICJXb3IiLCBzNCA9ICJsZCI7CiAgc3RkOjpzdHJpbmcgc3N1bSA9IHN1bShzMSwgczIsIHMzLCBzNCk7CgogIHN0ZDo6Y291dCA8PCBsc3VtIDw8IHN0ZDo6ZW5kbAogICAgICAgICAgICA8PCBzc3VtIDw8IHN0ZDo6ZW5kbDsKICByZXR1cm4gMDsKfQo=