Skip to content

Instantly share code, notes, and snippets.

@fredbr
Created May 16, 2018 03:36
Show Gist options
  • Save fredbr/92133ac8a49e9344e093b86b80edf656 to your computer and use it in GitHub Desktop.
Save fredbr/92133ac8a49e9344e093b86b80edf656 to your computer and use it in GitHub Desktop.
Órbitas
//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