Monopoly
Hazrat Ali
There are 44 companies in the markets of Chefland, AA, BB, CC, and DD.This year,
- Company AA made a profit of PP lakh rupees,
- Company BB made a profit of QQ lakh rupees,
- Company CC made a profit of RR lakh rupees,
- Company DD made a profit of SS lakh rupees.
There is said to be a monopoly in the market if the profit made by one company is strictly greater than the sum of profits made by all other companies.Determine if there is a monopoly in the market or not.
Input Format
- The first line of input will contain a single integer TT, denoting the number of test cases.
- The first line and only line of each test case contains four space-separated integers PP, QQ, RR and SS — the profits made by companies AA, BB, CC and DD respectively.
Output Format
For each test case, output YES
if there is a monopoly in the market. Otherwise, output NO
.
You may print each character of YES
and NO
in uppercase or lowercase (for example, yes
, yEs
, Yes
will be considered identical).
Constraints
- 1≤T≤5000
- 1≤P,Q,R,S≤100
Sample 1:
4 1 1 1 10 30 20 6 4 100 90 3 4 14 15 16 17
YES NO YES NO
Explanation:
Test Case 1: Here, company DD's profit (1010) is greater than the sum of profits of all other companies (1+1+1=3).
Test Case 2: Here, no company's profit is strictly greater than the sum of profits of all other companies.
Test Case 3: Here, company AA's profit (100100) is greater than the sum of profits of all other companies (90+3+4=97).
Solution