Peaceful Party Solution
Codechef February Cook-Off 2022
Problem Code : MAYOR_PARTY
Solution :
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
using namespace std;
void solve()
{
ll a, b, c;
cin >> a >> b >> c;
if (b >= (a + c))
cout << b << "\n";
else
cout << a + c << "\n";
}
int main()
{
ll t;
cin >> t;
while (t--)
{
solve();
}
}
Comments
Post a Comment