initial commit
This commit is contained in:
parent
a3b9ceff64
commit
86464962d4
27
1849A Morning Sandwich/1849A.cpp
Normal file
27
1849A Morning Sandwich/1849A.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
|
||||
void solve()
|
||||
{
|
||||
int b, c, h;
|
||||
cin>>b>>c>>h;
|
||||
if(b==c+h)
|
||||
cout<<b+c+h-1<<endl;
|
||||
else if(b>c+h)
|
||||
cout<<2*(c+h)+1<<endl;
|
||||
else
|
||||
cout<<2*b-1<<endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--) solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user