Given four integers
. Determine if there exists a binary string having
1’s such that the total number of subsequences equal to the sequence “01” in it is
and the total number of subsequences equal to the sequence “10” in it is
A binary string is a string made of the characters ‘0’ and ‘1’ only.
is a subsequence of a sequence
can be obtained from
by deletion of several (possibly, zero or all) elements.
The first line contains a single integer
), denoting the number of test cases.
Each of the next
lines contains four integers
)), as described in the problem.
For each test case, output “Yes” (without quotes) if a string with given conditions exists and “No” (without quotes) otherwise.
When x, y, a and b are 3, 2, 4 and 2 respectively, string 00110 is a valid string. So answer is Yes
When x, y, a and b are 3, 3, 4 and 3 respectively, we can’t find any valid string. So answer is No.