#P15445. 「IXOI R1」永远在一起!

    ID: 15121 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 5 上传者: 标签>贪心洛谷原创O2优化枚举位运算洛谷月赛

「IXOI R1」永远在一起!

Description

You have come to the wishing well for QQ consecutive days, everyday you have a positive integer xx in your hand, representing your wish.

Whether a wish can come true or not can not totally be controlled by an individual, so you are also given two parameters yy and zz each day by the well.

If there exist two unequal natural numbers aa and bb, where aorb=x,aby,a+bza\operatorname{or}b=x,|a-b|\le y,a+b\le z, the well will consider your wish achievable and return YES as an answer, otherwise it will consider the wish too difficult to realize and give you NO.

Here, aorba\operatorname{or}b denotes the bitwise OR operation between aa and bb, you can also consider it as | in C++. x|x| denotes the absolute value of xx.

You're eager to know the result every day.

Input Format

The first line of the input contains a single integer QQ: the amount of days you make wish.

The next QQ lines each contains three integers: x,yx,y and zz.

Output Format

QQ lines, each contains a string YES or NO, representing the result of the day.

2
5 2 9
3 9 2

YES
NO

Hint

Example Explanation

For x=5,y=2,z=9x = 5,y = 2,z = 9, a=5,b=4a = 5,b = 4 can meet the conditions.

For x=3,y=9,z=2x = 3,y = 9 ,z = 2, no aa and bb can meet the conditions.

Constraints

This problem uses bundled testing.

Subtask Id QQ\leq xx\leq Special property Points
00 1010 50005000 No 2020
11 10510^5 10910^9 Yes 3030
22 No 5050

Special property: It is guaranteed that z2×xz\ge 2\times x.

For all data, it is guaranteed that:

$1\le Q\le 10^5,1\le x,y\le 10^9,1\le z\le2\times10^9$.