比赛 202110省实验桐柏一中普及组联赛 评测结果 AAAAAAAAAA
题目名称 分数约分 最终得分 100
用户昵称 求索 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2021-10-20 18:47:05
显示代码纯文本
#include<bits/stdc++.h>
#define ull __int128
using namespace std;
 
ull x,y;
ull k;
ull gcd(ull a,ull b) {
	if(a<b){
		swap(a,b);
	} 
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

inline ull read() {
	ull x=0; 
	char ch=getchar();
	while (ch>='0' && ch<='9')
	 {
		x=x*10+ch-48; 
		ch=getchar();
	}
	return x;
}

inline void print(ull x) {
	if(x>9){
		print(x/10);
	}
	putchar(x%10+'0');
}

int main(){
	freopen("yuefen.in","r",stdin);
	freopen("yuefen.out","w",stdout);
	x=read();
	y=read();
//	print(x);
	k=gcd(y,x);
	print(x/k);
	printf(" ");
//	print(k);
	print(y/k);
	return 0;
}