-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1148A.cpp
85 lines (55 loc) · 2.05 KB
/
1148A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include<bits/stdc++.h>
using namespace std;
/// File input & output /////
#define fRead(x) freopen("x.txt","r",stdin)
#define fWrite(x) freopen ("x.txt","w",stdout)
#define mt make_tuple
#define ld long double
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define INF 2e16
#define PI acos(-1.0)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define min4(a,b,c,d) min(a,min(b,min(c,d)))
#define max4(a,b,c,d) max(a,max(b,max(c,d)))
#define SQR(a) ((a)*(a))
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define REP(i,b) for(int i=0;i<b;i++)
#define MEM(a,x) memset(a,x,sizeof(a))
#define ABS(x) ((x)<0?-(x):(x))
#define SORT(v) sort(v.begin(),v.end())
#define REV(v) reverse(v.begin(),v.end())
#define FASTIO ios_base::sync_with_stdio(0);cin.tie(nullptr);
///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
return a.second>b.second;
}
///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
const pair<int,int> &b)
{
return (a.first > b.first);
}
///.............................................................TEMPLATE................................................./////
int main()
{
FASTIO;
ll a , b , c;
cin >> a >> b >> c;
if(a==b)
{
cout << (2*c) + min(a,b) + min(a,b) << endl;
}
else
cout << (2*c) + min(a,b) + min(a,b) +1 << endl;
return 0;
}