rt。
玄学事件,如下代码将freopen注释后可以正常跑出答案,不注释就跑不出了,并且好像爆炸了。求大佬解答。
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
int a,b,c;
inline int lcm(int x,int y){
return x/__gcd(x,y)*y;
}
signed main(){
freopen("circle.in","r",stdin);
freopen("circle.out","w",stdout);
cin>>a>>b>>c;
int d=lcm(a,lcm(b,c));
int A=d/a,B=d/b,C=d/c;
int tmp=__gcd(A-B,B-C);
int p=__gcd(tmp,d);
cout<<(d/p)<<"/"<<(tmp/p)<<"\n";
}