SP13388 MAY99_3 - Easy Jug

Description

One day Manku was very thirsty so he decided to drink exactly z litres of water. However , in front of him, there is a well of infinite amount of water and 2 empty jugs of quantity x litres and y litres respectively. Now Manku can do the following operations to any jug 1. Fill it completely from the well 2. Empty it entirely 3. Transfer as much water from Jug 1 to Jug 2, till Jug 1 gets empty or Jug 2 is completely filled. Now since he has no measuring device so he will do these operations only to make any of the 2 jug having exactly z litres of water. Now Your task is given value of x, y, z, tell whether it is possible for Manku to drink water or not.

Input Format

First Line of Input contains T, the number of test cases. (T

Output Format

For each test case output "YES" if manku can drink exactly z litres of water else "NO".