#include <iostream>
#include <memory>
using namespace std;
template<typename ... Args>
string string_format(const string& format, Args ... args){
size_t size = 1 + snprintf(nullptr, 0, format.c_str(), args ...);
unique_ptr<char[]> buf(new char[size]);
snprintf(buf.get(), size, format.c_str(), args ...);
return string(buf.get(), buf.get() + size);
}
int main() {
//test the function here
cout << string_format("%d", 202412);
//<test>
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bWVtb3J5Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGU8dHlwZW5hbWUgLi4uIEFyZ3M+CnN0cmluZyBzdHJpbmdfZm9ybWF0KGNvbnN0IHN0cmluZyYgZm9ybWF0LCBBcmdzIC4uLiBhcmdzKXsKICAgIHNpemVfdCBzaXplID0gMSArIHNucHJpbnRmKG51bGxwdHIsIDAsIGZvcm1hdC5jX3N0cigpLCBhcmdzIC4uLik7CiAgICB1bmlxdWVfcHRyPGNoYXJbXT4gYnVmKG5ldyBjaGFyW3NpemVdKTsKICAgIHNucHJpbnRmKGJ1Zi5nZXQoKSwgc2l6ZSwgZm9ybWF0LmNfc3RyKCksIGFyZ3MgLi4uKTsKICAgIHJldHVybiBzdHJpbmcoYnVmLmdldCgpLCBidWYuZ2V0KCkgKyBzaXplKTsKfQoKaW50IG1haW4oKSB7CgkvL3Rlc3QgdGhlIGZ1bmN0aW9uIGhlcmUKCWNvdXQgPDwgc3RyaW5nX2Zvcm1hdCgiJWQiLCAyMDI0MTIpOwoJLy88dGVzdD4KCXJldHVybiAwOwp9