Chef wants to redecorate his house and is considering two different styles of interior design. Your task is to help him determine which style has a lower total cost.
Problem Description
For each interior design style:
Style 1:
Cost of tiling the floor: ( X_1 ) rupees
Cost of painting the walls: ( Y_1 ) rupees
Total cost: ( C_1 = X_1 + Y_1 )
Style 2:
Cost of tiling the floor: ( X_2 ) rupees
Cost of painting the walls: ( Y_2 ) rupees
Total cost: ( C_2 = X_2 + Y_2 )
Chef will choose the style with the lower total cost and you need to determine how much he will pay.
Input Format
The first line of input contains a single integer ( T ), denoting the number of test cases.
Each test case consists of a single line containing 4 space-separated integers: ( X_1, Y_1, X_2, Y_2 ).
Output Format
For each test case, output on a new line the amount Chef will pay for the interior design.
Constraints
( 1 \leq T \leq 100 )
( 1 \leq X_1, Y_1, X_2, Y_2 \leq 100 )
Examples
Sample Input
text
4
10 20 9 25
10 20 9 20
10 20 20 10
100 43 85 61
Sample Output
text
30
29
30
143
Explanation
Test case 1:
Style 1 cost: ( 10 + 20 = 30 )
Style 2 cost: ( 9 + 25 = 34 )
Minimum cost: ( 30 ) rupees
Test case 2:
Style 1 cost: ( 10 + 20 = 30 )
Style 2 cost: ( 9 + 20 = 29 )
Minimum cost: ( 29 ) rupees
Test case 3:
Style 1 cost: ( 10 + 20 = 30 )
Style 2 cost: ( 20 + 10 = 30 )
Both styles cost the same: ( 30 ) rupees
Test case 4:
Style 1 cost: ( 100 + 43 = 143 )
Style 2 cost: ( 85 + 61 = 146 )
Minimum cost: ( 143 ) rupees
Solution Directory
Please implement the solution in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.