[Solution] Maximise the Tastiness CodeChef Solution
Problem
Chef is making a dish that consists of exactly two ingredients. He has four ingredients and with tastiness and respectively. He can use either or as the first ingredient and either or as the second ingredient.
The tastiness of a dish is the sum of tastiness of its ingredients. Find the maximum possible tastiness of the dish that the chef can prepare.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains four space-separated integers and — the tastiness of the four ingredients.
Is it hot or cold CodeChef Solution
Maximise the Tastiness CodeChef Solution
N Buttons 1 Bulb CodeChef Solution
Valid Minimum CodeChef Solution
High Frequency CodeChef Solution
Output Format
For each test case, output on a new line the maximum possible tastiness of the dish that chef can prepare.
Explanation:
Test case : Chef can prepare a dish with ingredients and with a tastiness of .
Test case : Chef can prepare a dish with ingredients and with a tastiness of .
No comments:
Post a Comment