-
-
Save fredbr/92133ac8a49e9344e093b86b80edf656 to your computer and use it in GitHub Desktop.
Órbitas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//solucao de Davi Gabriel | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
int mdc(ll a, ll b){ | |
if(b == 0){ | |
return a; | |
} | |
ll j = max(a, b); | |
ll k = min(a, b); | |
return mdc(k, j%k); | |
} | |
int main() { | |
ll x, y; | |
cin >> x >> y; | |
ll mmc = (x*y)/mdc(x, y); | |
cout << mmc << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment