mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-30 23:36:26 +00:00
11 lines
185 B
C++
11 lines
185 B
C++
|
#include <bits/stdc++.h>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
int a, b;
|
||
|
cin >> a >> b;
|
||
|
cout << (a / __gcd(a, b) + b / __gcd(a, b) - 1) * __gcd(a, b) << endl;
|
||
|
return 0;
|
||
|
}
|