唯一了解完题意,几分钟做出来的题,不要觉得水平提高了,是这道题太水了,想明白了,分分钟搞定!
C - Snack
Takahashi is organizing a party.
At the party, each guest will receive one or more snack pieces.
Takahashi predicts that the number of guests at this party will be A or B.
Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.
We assume that a piece cannot be divided and distributed to multiple guests.
Input is given from Standard Input in the following format:
A BPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.
2 36When we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.
123 45618696100000 999999999900000void coder_solution() {
// 提升cin、cout效率
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long a, b;
cin >> a >> b;
cout << a * b / __gcd(a, b);
}
ll A, B;
//---------------------------------------------------------------------------------------------------
void _main() {
cin >> A >> B;
cout << lcm(A, B) << endl;
}