Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The office where the Chef works, has two guards who count how many times a person enters into the office building. Though the duty of a guard is 24 hours in a day, sometimes they fall asleep during their duty and do not track the entry of a person in the office building. But one good thing is that they never fall asleep at the same time. At least one of them remains awake and counts who enters into the office.
Now the boss of Chef wants to calculate how many times the Chef has entered into the building. The boss asked to the guard and they gave him two integers A and B, the count of first guard and second guard respectively.
Help the boss to count the minimum and maximum number of times Chef could have entered into the office building.
The first line of the input contains an integer T denoting the number of test cases. The description of the T test cases follows.
Each test case consists of a line containing two space separated integers A and B.
For each test case, output a single line containing two space separated integers, the minimum and maximum number of times Chef could have entered into the office building.
Input:
1
19 17
Output:
19 36
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define endl "\n"
int main() {
// your code goes here
fast
int t;cin>>t;
while(t--)
{
int a,b;cin>>a>>b;
cout<<max(a,b)<<' '<<a+b<<'\n';
}
return 0;
}
# cook your dish here
for i in range(int(input())):
A,B=map(int,input().split())
print(max(A,B),A+B)
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0){
int a=s.nextInt();
int b=s.nextInt();
if(a>=b)
System.out.print(a);
else
System.out.print(b);
System.out.println(" "+(a+b));
}
}
}
In our experience, we suggest you solve this Chef and Remissness CodeChef Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
If you are stuck anywhere between any coding problem, just visit Queslers to get the Chef and Remissness CodeChef Solution
I hope this Chef and Remissness CodeChef Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>