#include <iostream>
using namespace std;
/*int mulByTwo(int v) { cout << "INT\n"; return v*2;}
double mulByTwo(double v) { cout << "DOUBLE\n"; return v*2;}*/
template<typename T> T mulByTwo(T v) { return v*2;}
int main() {
int I = mulByTwo(2); cout << I << endl;
int D = mulByTwo(2.0); cout << D << endl;
//string S = mulByTwo("it will not compile");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCi8qaW50IG11bEJ5VHdvKGludCB2KSB7IGNvdXQgPDwgIklOVFxuIjsgcmV0dXJuIHYqMjt9CmRvdWJsZSBtdWxCeVR3byhkb3VibGUgdikgeyBjb3V0IDw8ICJET1VCTEVcbiI7IHJldHVybiB2KjI7fSovCgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPiBUIG11bEJ5VHdvKFQgdikgeyByZXR1cm4gdioyO30KCmludCBtYWluKCkgewoJCglpbnQgSSA9IG11bEJ5VHdvKDIpOyBjb3V0IDw8IEkgPDwgZW5kbDsKCWludCBEID0gbXVsQnlUd28oMi4wKTsgY291dCA8PCBEIDw8IGVuZGw7CgkKCQoJLy9zdHJpbmcgUyA9IG11bEJ5VHdvKCJpdCB3aWxsIG5vdCBjb21waWxlIik7CgkKCXJldHVybiAwOwp9