#Lutece0110. Final Guessing
Final Guessing
Migrated from Lutece 110 Final Guessing
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
The new season of UESTC programming contest is coming, before the contest, the lottery area in the BBS of stuhome give out a new lottery to forecast this year's most clever student in the UESTC!
As the odds is given, love8909 is 1:2
,and stephydx is 1:3
, which is to say if you buy one coin for love8909 and he win the contest, you will get two coins back, so that you will have earned one coin in this lottery!
lxhgww feels it is quite interesting, so now he comes to the stuhome BBS to buy the lottery, no one want to lose money, so dose him. Now, lxhgww wants to know whether there is a strategy to buy the lottery that he can always earn no matter who would be the winner of the contest!
Input
The first line of the input contains one integer , which indicates the number of test cases. For each test case, in the first line an integer meaning there are people join the contest (), then lines are given, each line contains two integers and , the numbers in line is indicating the odds of contestants is A : B
.
Output
Output Yes
if lxhgww have a way to buy the lottery so that he can always win. Otherwise, output No
.
Samples
1
2
1 2
1 3
Yes
Note
If lxhgww buy coins for the first person, and coins for the second, so that he totally used coins, and if the first person wins, he can get coins back, if the second person wins, he can get coins back. So that lxhgww can always win in this way.
Resources
The 7th UESTC Programming Contest Final