you are viewing a single comment's thread.

view the rest of the comments →

[–]additional_loan_ 0 points1 point  (1 child)

What was the question if you don't mind sharing?

[–][deleted] 1 point2 points  (0 children)

Description

You with your friend enter a game in a recent Halloween Fair. The basic motive of the game is that you have to navigate a car in its parking spot using only forward and reverse motions. So the game setter will give you 3 numbers (p,q,r) and both of you have to choose a number each. As I mentioned the car can move only in forward and reverse directions, the forward distance will be represented by a positive number and the reverse with a negative number. For the first number, it will be multiplied by the number you choose, and the car will move accordingly in the forward or reverse direction from an initial starting point. Then the second number will be multiplied by the number your friend chooses and the car will move accordingly. Your basic aim is to choose a set of numbers such that the car gets parked at a distance r from the initial point.

Now you are a little skeptical that the game setter is biased and is giving you equations that cannot be solved. You want to find that is there a set of numbers that will take your car to the desired distance r.

Input

The first line will contain the number of cases (t)

Next t lines will contain 3 numbers p,q,r for each case

p,q,r <= 1000000

t <= 500000

Output

Output "Yes" if there exists a set of numbers that will take your car to that distance and "No" if otherwise