#include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef pair T; long long int INF = 2e18; const ll fact_table = 1200008; double Pi = 3.1415926535897932384626; priority_queue pql; priority_queue

pqp; priority_queue

bag; //big priority queue priority_queue ,greater > pqls; priority_queue ,greater

> pqps; //small priority queue //top pop ll dx[8]={1,0,-1,0,1,1,-1,-1}; ll dy[8]={0,1,0,-1,1,-1,-1,1}; char dir[] = "DRUL"; //↓,→,↑,← #define endl "\n" #ifdef ENJAPMA #undef endl #endif #define p(x) cout<=1; i--){ rfact[i-1] = rfact[i] * i; rfact[i-1] %= mod; } return;} ll c3(ll n,ll r){ return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;} ll mygcd(ll a, ll b){ if(b > a)swap(a, b); if(b == 0 || a == b){ return a; }else{ return mygcd(b, a % b); } } bool multicase = false; ll n,m,num,a,b,c,d,e,h,q; ll w, k; ll x[300006], y[100], z[100]; bool ok = false; bool flag = false; vector v1 = {2,2,1,1,2,1,0,0,0}; vector v2 = {3,3,2,2,1,3,2,1,0,0,0,1}; vector v3 = {4,3,3,2,2,1,3,2,1,4,1,0,0,0,4}; vector v4 = {1,-1,1,1,0,0,0}; vector v5 = {2,-1,1,2,2,1,0,0,0,1}; vector v6 = {3,-1,1,2,3,3,1,2,0,2,0,1,0}; void paint(ll maxi, ll l, ll r, bool hanpa){ if(!hanpa){ if(maxi <= 4){ // 例外処理 if(maxi == 1){ assert(false); }else if(maxi == 2){ for(ll i=0;i=maxi/2;i--){ x[idx] = i; x[idx+1] = i; idx += 2; } for(ll i=maxi;i>=maxi/2;i--){ x[idx] = i; idx ++; } paint(maxi/2 - 1, idx, r, false); }else{ ll idx = l; for(ll i=maxi;i>=(maxi+1)/2;i--){ x[idx] = i; x[idx+1] = i; idx += 2; } x[idx] = maxi / 2; idx ++; for(ll i=maxi;i>=(maxi+1)/2;i--){ x[idx] = i; idx ++; } x[idx] = maxi / 2; idx ++; x[idx+1] = maxi / 2; paint(maxi/2-1, idx, r, true); } }else{ ll idx = l; if(maxi <= 3){ // 例外処理 if(maxi == 1){ for(ll i=0;i=(maxi+1)/2;i--){ x[idx] = i; x[idx+1] = i; idx += 2; } x[idx] = x[idx+1] = maxi; idx += 2; for(ll i=maxi-1;i>=(maxi+1)/2;i--){ x[idx] = i; idx ++; } paint(maxi/2, idx, r, false); }else{ x[idx] = maxi; idx += 2; for(ll i=maxi-1;i>=maxi/2+1;i--){ x[idx] = i; x[idx+1] = i; idx += 2; } x[idx] = maxi/2; idx += 1; x[idx] = x[idx+1] = maxi; idx += 2; for(ll i=maxi-1;i>=maxi/2;i--){ x[idx] = i; idx ++; } x[idx+1] = maxi/2; paint(maxi/2-1, idx, r, true); } } } } void calc(ll n){ if(n == 1){ pe(0);pe(0);p(0); return; }else if(n == 2){ p(-1); return; } paint(n - 1, 1, 3*n, false); reverse(x + 1, x + n * 3 + 1); for(ll i=1;i<=n*3;i++){ pe(x[i]); } el; } void solve(){ cin >> a >> b; if(a == b){ p(a + b - 1); }else{ p(min(a, b) * 2); } return; } int main(){ // init(); ios::sync_with_stdio(false); cin.tie(nullptr); ll q, testcase = 1; if(multicase){ cin >> q; }else{ q = 1; } while(q--){ // pu("Case ");pu("#");pu(testcase);pu(": "); solve(); testcase++; } // solve(); return 0; }