#include <cstdarg>
#include <iostream>
#include <vector>
void SendMsg(int x, std::string format, ...)
{
va_list vl;
va_start(vl, format);
vprintf(format.c_str(), vl);
va_end(vl);
std::cout << std::endl;
};
template <typename... Ts>
void FOO(int x, const std::string& format, Ts... args)
{
SendMsg(x, format + "%s %d", args..., "xyz", 123);
}
void FOO(int x)
{
SendMsg(x, "%s %d", "xyz", 123);
}
int main()
{
FOO(42, "prefix %f ", 4.2f);
FOO(42);
}
I2luY2x1ZGUgPGNzdGRhcmc+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KCnZvaWQgU2VuZE1zZyhpbnQgeCwgc3RkOjpzdHJpbmcgZm9ybWF0LCAuLi4pCnsKICAgIHZhX2xpc3Qgdmw7CiAgICB2YV9zdGFydCh2bCwgZm9ybWF0KTsKICAgIHZwcmludGYoZm9ybWF0LmNfc3RyKCksIHZsKTsKICAgIHZhX2VuZCh2bCk7CiAgICBzdGQ6OmNvdXQgPDwgc3RkOjplbmRsOwp9OwoKdGVtcGxhdGUgPHR5cGVuYW1lLi4uIFRzPgp2b2lkIEZPTyhpbnQgeCwgY29uc3Qgc3RkOjpzdHJpbmcmIGZvcm1hdCwgVHMuLi4gYXJncykKewogICAgU2VuZE1zZyh4LCBmb3JtYXQgKyAiJXMgJWQiLCBhcmdzLi4uLCAieHl6IiwgMTIzKTsKfQoKdm9pZCBGT08oaW50IHgpCnsKICAgIFNlbmRNc2coeCwgIiVzICVkIiwgInh5eiIsIDEyMyk7Cn0KCmludCBtYWluKCkKewogICAgRk9PKDQyLCAicHJlZml4ICVmICIsIDQuMmYpOwogICAgRk9PKDQyKTsKfQo=