#BZOJ2299. 向量

向量

题目描述

<w:WordDocument>

<w:View>Normal</w:View>

<w:Zoom>0</w:Zoom>

<w:PunctuationKerning />

<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>

<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>

<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>

<w:ValidateAgainstSchemas />

<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>

<w:IgnoreMixedContent>false</w:IgnoreMixedContent>

<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>

<w:Compatibility>

<w:SpaceForUL />

<w:BalanceSingleByteDoubleByteWidth />

<w:DoNotLeaveBackslashAlone />

<w:ULTrailSpace />

<w:DoNotExpandShiftReturn />

<w:AdjustLineHeightInTable />

<w:BreakWrappedTables />

<w:SnapToGridInCell />

<w:WrapTextWithPunct />

<w:UseAsianBreakRules />

<w:DontGrowAutofit />

<w:UseFELayout />

</w:Compatibility>

<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>

</w:WordDocument>

</xml><![endif]--><!--[if gte mso 9]><xml>

<w:LatentStyles DefLockedState="false" LatentStyleCount="156">

</w:LatentStyles>

</xml><![endif]--><!--[if gte mso 10]>

<style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style>

<![endif]-->

给你一对数a,b,你可以任意使用(a,b), (a,-b), (-a,b), (-a,-b), (b,a), (b,-a), (-b,a), (-b,-a)这些向量,问你能不能拼出另一个向量(x,y)

说明:这里的拼就是使得你选出的向量之和为(x,y)

 

输入格式

第一行数组组数t(t<=50000)

接下来t行每行四个整数a,b,x,y  (-2*109<=a,b,x,y<=2*109)

输出格式

 

t行每行为Y或者为N,分别表示可以拼出来,不能拼出来

3
2 1 3 3
1 1 0 1
1 0 -2 3
Y
N
Y

数据范围与约定

 



样例解释:



第一组:(2,1)+(1,2)=(3,3)



第三组:(-1,0)+(-1,0)+(0,1)+(0,1)+(0,1)=(-2,3)