Skip to content

Commit 94e3284

Browse files
committed
Added 1611B - Team Composition: Programmers and Mathematicians.cpp
1 parent d52467d commit 94e3284

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int t;
12+
cin>>t;
13+
while(t--)
14+
{
15+
int a, b;
16+
cin >> a >> b;
17+
if (a < b)
18+
swap(a,b);
19+
int dif= abs(a-b);
20+
int threeAndOne= dif/2;
21+
int ans= min(threeAndOne,b) + (b-min(threeAndOne,b))/2;
22+
cout << ans << "\n";
23+
}
24+
return 0;
25+
}
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+

0 commit comments

Comments
 (0)