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.

14 lines
356 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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;
}