#include <iostream>
#include <cmath>
using namespace std;
template <typename T> double sgn(T val) {
return double((T(0) < val) - (val < T(0)))/(val == val);
}
int main() {
cout << "sgn(-1) : " << sgn(-1) << endl;
cout << "sgn(0) : " << sgn(0) << endl;
cout << "sgn(1) : " << sgn(1) << endl;
cout << "sgn(-INFINITY): " << sgn(-INFINITY) << endl;
cout << "sgn(-1.0) : " << sgn(-1.0) << endl;
cout << "sgn(-0.0) : " << sgn(-0.0) << endl;
cout << "sgn(0.0) : " << sgn(+0.0) << endl;
cout << "sgn(+1) : " << sgn(+1.0) << endl;
cout << "sgn(INFINITY) : " << sgn(+INFINITY) << endl;
cout << "sgn(NAN) : " << sgn(NAN) << endl;
cout << "sgn(-NAN) : " << sgn(-NAN) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4gZG91YmxlIHNnbihUIHZhbCkgewogICAgcmV0dXJuIGRvdWJsZSgoVCgwKSA8IHZhbCkgLSAodmFsIDwgVCgwKSkpLyh2YWwgPT0gdmFsKTsKfQoKaW50IG1haW4oKSB7CiAgY291dCA8PCAic2duKC0xKSAgICAgICA6ICIgPDwgc2duKC0xKSA8PCBlbmRsOwogIGNvdXQgPDwgInNnbigwKSAgICAgICAgOiAiIDw8IHNnbigwKSA8PCBlbmRsOwogIGNvdXQgPDwgInNnbigxKSAgICAgICAgOiAiIDw8IHNnbigxKSA8PCBlbmRsOwogIGNvdXQgPDwgInNnbigtSU5GSU5JVFkpOiAiIDw8IHNnbigtSU5GSU5JVFkpIDw8IGVuZGw7CiAgY291dCA8PCAic2duKC0xLjApICAgICA6ICIgPDwgc2duKC0xLjApIDw8IGVuZGw7CiAgY291dCA8PCAic2duKC0wLjApICAgICA6ICIgPDwgc2duKC0wLjApIDw8IGVuZGw7CiAgY291dCA8PCAic2duKDAuMCkgICAgICA6ICIgPDwgc2duKCswLjApIDw8IGVuZGw7CiAgY291dCA8PCAic2duKCsxKSAgICAgICA6ICIgPDwgc2duKCsxLjApIDw8IGVuZGw7CiAgY291dCA8PCAic2duKElORklOSVRZKSA6ICIgPDwgc2duKCtJTkZJTklUWSkgPDwgZW5kbDsKICBjb3V0IDw8ICJzZ24oTkFOKSAgICAgIDogIiA8PCBzZ24oTkFOKSA8PCBlbmRsOwogIGNvdXQgPDwgInNnbigtTkFOKSAgICAgOiAiIDw8IHNnbigtTkFOKSA8PCBlbmRsOwoJcmV0dXJuIDA7Cn0=