Advertisement
Guest User

Untitled

a guest
May 24th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. template <class T> T inline input(string s = ""){
  8.     T _data;
  9.     cout << s;
  10.     cin >> _data;
  11.     return _data;
  12. }
  13.  
  14. int main(){
  15.     int n = input<int>(), m = input<int>();
  16.     cout << min(n, m) * 2 - 1 - ((n + m) % 2 == 0 && n != m? 1 : 0);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement