#include <iostream>
using namespace std;
template <int nMin = 0, int nMax = 5>
int clamp_asdf(int n)
{
return n < nMin ? nMin : n <= nMax ? n : nMax;
}
template <>
int clamp_asdf<0, 0>(int n)
{
cout << "clamp_asdf<0, 0>\n";
return 0;
}
int main() {
cout << clamp_asdf(8) << endl;
cout << clamp_asdf<7,10>(8) << endl;
cout << clamp_asdf<0,0>(8) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdGVtcGxhdGUgPGludCBuTWluID0gMCwgaW50IG5NYXggPSA1PgppbnQgY2xhbXBfYXNkZihpbnQgbikKewogICAgcmV0dXJuIG4gPCBuTWluID8gbk1pbiA6IG4gPD0gbk1heCA/IG4gOiBuTWF4Owp9Cgp0ZW1wbGF0ZSA8PgppbnQgY2xhbXBfYXNkZjwwLCAwPihpbnQgbikKewoJY291dCA8PCAiY2xhbXBfYXNkZjwwLCAwPlxuIjsKICAgIHJldHVybiAwOwp9CgoKaW50IG1haW4oKSB7Cgljb3V0IDw8IGNsYW1wX2FzZGYoOCkgPDwgZW5kbDsKCWNvdXQgPDwgY2xhbXBfYXNkZjw3LDEwPig4KSA8PCBlbmRsOwoJY291dCA8PCBjbGFtcF9hc2RmPDAsMD4oOCkgPDwgZW5kbDsKCQoJcmV0dXJuIDA7Cn0K