Description
Problem A. Is it hot or cold
Time limit 1000 ms Code length Limit 50000 B
OS Linux
Chef considers the climate HOT if the temperature is above 20, otherwise he considers it COLD .
You are given the temperature C, find whether the climate is HOT or COLD .
Input Format
The first line of input will contain a single integer T , denoting the number of test cases. The first and only line of each test case contains a single integer, the temperature C.
Output Format
For each test case, print on a new line whether the climate is HOT or COLD .
Constraints
1≤T ≤50 0≤C≤40
Sample 1
Input Output
2
21
16 HOT
COLD
Test case 1: The temperature is 21, which is more than 20. So, Chef considers the climate HOT .
Test case 2: The temperature is 16, which is not more than 20. So, Chef considers the climate COLD .
–
Problem B. Maximise the Tastiness
Time limit 1000 ms Code length Limit 50000 B
OS Linux
Chef is making a dish that consists of exactly two ingredients. He has four ingredients A,B,C and D with tastiness a,b,c, and d respectively. He can use either A or B as the first ingredient and either C or D 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 T , denoting the number of test cases. The first and only line of each test case contains four space-separated integers a,b,c, and d — the tastiness of the four ingredients.
Output Format
For each test case, output on a new line the maximum possible tastiness of the dish that chef can prepare.
Constraints
1 ≤ T ≤ 100
1 ≤ a,b,c,d ≤ 100
Sample 1
Input Output
2
3 5 6 2
16 15 5 4 11
21
Test case 1: Chef can prepare a dish with ingredients B and C with a tastiness of 5 + 6 = 11.
Test case 2: Chef can prepare a dish with ingredients A and C with a tastiness of 16 + 5 = 21.
–




Reviews
There are no reviews yet.