1493. Industrial Nuclear Water

Giant Kingdom creates tons of drinkable water, and will discharge the water into an ocean. The ocean can be simplified to a 3-dimensional space. Because of some magic, there are 3 surfaces, 1000|x|=y^2+z^2,1000|y|=x^2+z^2,1000|z|=x^2+y^2, and water can't pass through any of the surfaces. Baby Kingdom is worried about whether the drinkable water can reach their country.

Given are two coordinates (x_1,y_1,z_1),(x_2,y_2,z_2) indicate the position of Giant Kingdom and the position of Baby Kingdom. Please find out weather the drinkable water can reach Baby Kingdom. It is guaranteed that both countries do not located in any of the surfaces.

You need to answer T queries.

输入

First line contains one integer T (1\leq T \leq 10^3). Next T lines, the i-th line contains 6 integers x_1,y_1,z_1,x_2,y_2,z_2 (-10^9\leq x_1,y_1,z_1,x_2,y_2,z_2\leq 10^9), indicating the i-th query.

输出

T lines, in the i-th line print Yes if the drinkable water can reach Baby Kingdom, print No otherwise.

样例

标准输入 复制文本
3
1 0 0 2 0 0
1 0 0 -1 0 0
1 0 0 1 1 0
标准输出 复制文本
Yes
No
No

提示

In example, query 3, the surface divide (1,0,0),(1,1,0) is 1000|y|=x^2+z^2.

来源

2021 GDCPC 广东省大学生程序设计竞赛

登录以提交代码。
单点时限 1 秒
内存限制 512 MB
提交 12
通过 6