比赛 202110省实验桐柏一中普及组联赛 评测结果 TTTTTTTTTT
题目名称 分数约分 最终得分 0
用户昵称 ming_xin 运行时间 10.000 s
代码语言 C++ 内存使用 5.74 MiB
提交时间 2021-10-18 20:33:02
显示代码纯文本
#include<bits/stdc++.h> 
using namespace std;
unsigned long long gcd(unsigned long long a,unsigned long long b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    else gcd(b,a%b);
}
inline unsigned long long read()
{
   register unsigned long long s=0,w=1;
   register char ch=getchar();
   while(ch<'0'||ch>'9')
   {
        if(ch=='-')
        {
            w=-1;
            ch=getchar();   
        }
   }
   while(ch>='0'&&ch<='9') 
   {
        s=s*10+ch-'0';
        ch=getchar();
   }
   return s*w;
}
int main(void)
{
	freopen("yuefin.in","r",stdin);
	freopen("yuefin.out","w",stdout);
	unsigned long long x,y;
	x = read(); y = read();
	unsigned long long c = gcd(x,y);
	printf("%lld %lld",(x/c), (y/c));
	return 0;
}