EQCHECK - Equation Check

no tags 

Given an equation of a straight line of form Ax+By=C. A,B,C are integers. You have to check if it passes through any lattice point or not.

Input

First line => T = No of test cases < 100

Next T lines contains the equation of form Ax+By=C. 1 < A,B,C < 10^6

Output

Print 'yes' if line passes through any lattice point, else print 'no' for each test case.

Example

Input:
2
2x+3y=4
6x+8y=25

Output: yes
no

Score : Source Code Length

hide comments
Samil Vargas: 2014-02-13 19:27:28

:) i learn a lot with this problem

(Tjandra Satria Gunawan)(曾毅昆): 2014-02-13 19:27:28

My poor AWK code still shorter than my best C code :-O

pika_pika: 2014-02-13 19:27:28

_/\_ to numerix, whereas i got 247 in pyth3.2.3 easy but my solution wasn't small enough :(

Mukesh Tiwari: 2014-02-13 19:27:28

my soln id 7166467
i think mine is correct....i am getting wa again and again :P

Paras Sharma: 2014-02-13 19:27:28

could you please check my submission 6448423.
it should be accepted *-)

Re(XeRon!X) : 63x+23y=7

Last edit: 2012-02-06 17:09:28
numerix: 2014-02-13 19:27:28

Ever heard of "google"?

ravi shankar prasad : 2014-02-13 19:27:28

What is lattice point?

RE(Debanjan):Here the Latice point is used in the same sense as http://mathworld.wolfram.com/LatticePoint.html

Last edit: 2011-04-10 19:39:34

Added by:XeRoN!X
Date:2011-03-30
Time limit:1s
Source limit:256B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64