EQCHECK - Equation Check
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
|
|
Paras Sharma:
2014-02-13 19:27:28
could you please check my submission 6448423.
|
|
numerix:
2014-02-13 19:27:28
Ever heard of "google"? |
|
ravi shankar prasad :
2014-02-13 19:27:28
What is lattice point?
|
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 |