Problem
Chef got his dream seat in F1
and secured a place in his debut race. He now wants to know the time gap between him and the winner of the race.
You are his chief engineer and you only know the time gap between Chef and the runner up of the race, given as seconds, and the time gap between the runner up and the winner of the race, given as seconds.
Please calculate and inform Chef about the time gap between him and the winner of the race.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of a single line of input containing two space-separated integers and denoting the time gap between Chef and the runner up and the time gap between the runner up and the winner respectively.
Output Format
For each test case, output the time gap between Chef and the winner of the race.
Constraints
Sample 1:
4 1 1 2 5 3 2 5 6
2 7 5 11
Explanation:
Test case : The time gap between Chef and runner up is second. The time gap between runner up and the winner is second. Thus, the time gap between Chef and the winner is seconds.
Test case : The time gap between Chef and runner up is seconds. The time gap between runner up and the winner is second. Thus, the time gap between Chef and the winner is seconds.
Test case : The time gap between Chef and runner up is seconds. The time gap between runner up and the winner is second. Thus, the time gap between Chef and the winner is seconds.
Test case : The time gap between Chef and runner up is seconds. The time gap between runner up and the winner is second. Thus, the time gap between Chef and the winner is seconds.
Code:-
- Swap adjacent characters
- Double the vowel characters
- Check valid parenthesis
- Print the characters with their frequencies
- Find closest value
- Word Count
- Program of CaesarCipher
- Program to find the perfect city
- Annual Day | Tech Mahindra coding question
- Find the number of pairs in the array whose sum is equal to a given target.
Wipro :-
- Update the booking ID | Wipro previous year question paper solution
- Pages in PDF
- Find the location id
- Find the odd digits
- Find the Product ID
Infytq :-
Key Points;-
Hackerrank:-
- Python : missing characters : hackerrank solution
- Python : string transformation | Hackerrank solution
- Active Traders certification test problem | Hackerrank Solution
- Usernames changes certification test problem | Hackerrank Solution
- string Representation of objects certification test hackerrank solution
- Average Function | hackerrank certification problem solution
C-tutorial:-
- Micros in C
- Pointer in c
- Function declaration
- Types of user define function
- return type of function
- 2D array
See more:-
- c program to convert specified days into years weeks and days
- Print Reverse Hollow Pyramid
- Update the booking ID | Wipro previous year question paper
- Pages in PDF | Wipro previous year question paper
- Sparse Matrix in data structure
- Find the location ID | Wipro previous year Coding question
- find the odd digits | Wipro Coding question
- Find the product id | Wipro Coding question
- Difference between static and dynamic memory allocation
- What is asymptotic Notation
0 Comments