You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
using namespace std;
|
|
|
|
|
// https://blog.csdn.net/gl620321/article/details/104907041/
|
|
|
|
|
/*
|
|
|
|
|
通过找规律可以得到,如果(p, q)=d=1(互质), 最大的凑不出来的数是a*b-a-b.
|
|
|
|
|
这个可以看作是一个定理
|
|
|
|
|
*/
|
|
|
|
|
int main() {
|
|
|
|
|
int a, b;
|
|
|
|
|
cin >> a >> b;
|
|
|
|
|
cout << a * b - a - b << endl;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|