#include <iostream>
using namespace std;
template<typename T>
T vmin(T val1, T val2)
{
return val1 < val2 ? val1 : val2;
}
template<typename T, typename... Ts>
T vmin(T val1, T val2, Ts&&... vs)
{
return val1 < val2 ?
vmin(val1, std::forward<Ts>(vs)...) : vmin(val2, std::forward<Ts>(vs)...);
}
int main()
{
cout << vmin(3, 2, 1, 2, 5) << endl;
cout << vmin(3., 1.2, 1.3, 2., 5.2) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgoKdGVtcGxhdGU8dHlwZW5hbWUgVD4KVCB2bWluKFQgdmFsMSwgVCB2YWwyKQp7CglyZXR1cm4gdmFsMSA8IHZhbDIgPyB2YWwxIDogdmFsMjsKfQoKdGVtcGxhdGU8dHlwZW5hbWUgVCwgdHlwZW5hbWUuLi4gVHM+ClQgdm1pbihUIHZhbDEsIFQgdmFsMiwgVHMmJi4uLiB2cykKewoJcmV0dXJuIHZhbDEgPCB2YWwyID8KCQl2bWluKHZhbDEsIHN0ZDo6Zm9yd2FyZDxUcz4odnMpLi4uKSA6IHZtaW4odmFsMiwgc3RkOjpmb3J3YXJkPFRzPih2cykuLi4pOwp9CgoKaW50IG1haW4oKQp7Cgljb3V0IDw8IHZtaW4oMywgMiwgMSwgMiwgNSkgPDwgZW5kbDsKCQoJY291dCA8PCB2bWluKDMuLCAxLjIsIDEuMywgMi4sIDUuMikgPDwgZW5kbDsKCglyZXR1cm4gMDsKfQ==