Burgers

Tags : codechef, math, cpp, easy

Chef is fond of burgers and decided to make as many burgers as possible.

Chef has A patties and B buns. To make 1 burger, Chef needs 1 patty and 1 bun. Find the maximum number of burgers that Chef can make.

Input Format:

Output Format:

For each test case, output the maximum number of burgers that Chef can make.

Examples #

Example 1:

Input :
4
2 2
2 3
3 2
23 17

Output :
2
2
2
17

Explanation :
Test Case 1: Chef has 2 patties and 2 buns, and therefore Chef can make 2 burgers.

Test Case 2: Chef has 2 patties and 3 buns, and therefore Chef can make 2 burgers.

Test Case 3: Chef has 3 patties and 2 buns, and therefore Chef can make 2 burgers.

Test Case 4: Chef has 23 patties and 17 buns, and therefore Chef can make 17 burgers.

Constraints #

Solutions #

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
int MOD = 1e9+7;

int solution(int a, int b) {
    return min(a, b);
}

int main() {
	// your code goes here
	int T; cin >> T;
	int a,b;
	while(T--) {
	    cin >> a >> b;
	    auto res = solution(a, b);
	    cout << res << endl;
	}
	return 0;
}