initial commit

This commit is contained in:
ShazidMahsrafi 2023-07-30 01:00:33 +06:00
parent a3b9ceff64
commit 86464962d4

View 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();
}