#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i>t1>>t2>>t3; Ratio p = {t1,t2-t1}; yakubun(p); Ratio p2 = p; p2.up *= t2; p2.down *= t3; yakubun(p2); int N = 1; while(true){ Ratio a = p, b = p2; a.up *= N; b.up *= N; yakubun(a); osae(a); yakubun(b); osae(b); if(a.up==b.up && a.down==b.down)break; ++N; } Ratio ans = {N*t1*t2, t2-t1}; yakubun(ans); printf("%lld/%lld\n",ans.up,ans.down); return 0; }