#include #include double const pi = 3.1415926535897932385; static double pyr(double x, double t){ if(t<0) return pyr(x, -t); if(x<0) return pyr(-x, t); if(t>pi) return -pyr(x, t-pi); if(x>pi) return -pyr(x-pi, t); if(x>pi/2) return -pyr(pi-x, t); if(t>pi/2) return -pyr(x, pi-t); return x+t