#include int max(const int x, const int y) { return (xy?y:x); } int sgn(const int x) { if (x>0) return 1; else if (x<0) return -1; else return 0; }