#C9838. Minimum Water Requirement Checker

    ID: 53975 Type: Default 1000ms 256MiB

Minimum Water Requirement Checker

Minimum Water Requirement Checker

Given water amounts for four friends, determine whether any two of them can combine their water to meet or exceed a required minimum amount. Formally, given water quantities (W_1, W_2, W_3, W_4) and a requirement (L), check if there exists a pair ((i, j)) with (i < j) such that (W_i + W_j \ge L). You are also given multiple test cases, and you need to output the result for each test case. This problem tests simple iteration and pairwise comparison.

inputFormat

The first line of input contains an integer (T) representing the number of test cases. Each of the following (T) lines contains 5 space-separated integers: (W_1), (W_2), (W_3), (W_4) and (L), where (W_1, W_2, W_3, W_4) are the water amounts for four friends and (L) is the minimum water requirement.

outputFormat

For each test case, output a single line containing either 'YES' if there exists any two friends whose combined water amount is at least (L); otherwise, output 'NO'.## sample

3
10 20 15 5 25
8 4 3 2 7
50 60 70 80 100
YES

YES YES

</p>