Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
326 B
1
Indexable
Never
//Bai 1
#include <iostream>

using namespace std;

int gcd(int a, int b){
	if(b == 0) return a;
	return gcd(b,a%b);
}

int main(){
	freopen("vn.inp","r",stdin);
	freopen("vn.out","w",stdout);

	int g, n, m; cin >> n >> m;
	g = gcd(n,m);
	cout << g << endl;
	cout << n/g << " " << m/g << endl;

	return 0;
}
Leave a Comment