魅族mx3

noip模拟【20171102】

吃可爱长大的小学妹 提交于 2019-11-27 19:02:21
T1 [数学] 期望得分:100 先通分,求出分子的最小公倍数,再讨论跟共同的分母B*D的关系即可。 【code】 #include<bits/stdc++.h> using namespace std; #define ll long long #define File "tile" inline void file(){ freopen(File".in","r",stdin); freopen(File".out","w",stdout); } inline int read(){ int x = 0,f = 1; char ch = getchar(); while(ch < '0' || ch > '9'){if(ch=='-')f = -1; ch = getchar();} while(ch >= '0' && ch <= '9'){x = (x<<1) + (x<<3) + ch-'0'; ch = getchar();} return x*f; } //const int mxn = ; int T,A,B,C,D; ll gcd(ll x,ll y){ return y ? gcd(y,x%y) : x; } int main(){ file(); T = read(); while(T--){ A = read(),B = read(),C = read()