#include #define p(s) cout<<(s)<>N>>D; p(N/__gcd(N,D)-1); return 0; }