fork download
  1. #include <cmath>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8. typedef long long ll;
  9.  
  10. ll arr[5 * 100000 * 18];
  11.  
  12. int main() {
  13. /* Enter your code here. Read input from STDIN. Print output to STDOUT */
  14. ll a, b;
  15. cin>>a>>b;
  16.  
  17. ll ans = min(a-1+a*(b-1), b-1+b*(a-1));
  18. cout<<ans;
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 73792KB
stdin
Standard input is empty
stdout
7277802426654177791