Submission #10191425


Source Code Expand

Copy
a, b, c = gets.strip.split.map(&:to_i)

puts (1..b).any? {|i| i * a % b == c} ? "YES" : "NO"

Submission Info

Submission Time
Task B - Choose Integers
User akht
Language Ruby (2.3.3)
Score 200
Code Size 96 Byte
Status
Exec Time 7 ms
Memory 3836 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2, example3, example4
All 200 / 200 ansno0, ansno1, ansno2, ansno3, ansno4, ansyes0, ansyes1, ansyes2, ansyes3, ansyes4, example0, example1, example2, example3, example4
Case Name Status Exec Time Memory
ansno0 7 ms 1788 KB
ansno1 7 ms 1788 KB
ansno2 7 ms 1788 KB
ansno3 7 ms 1788 KB
ansno4 7 ms 1788 KB
ansyes0 7 ms 3836 KB
ansyes1 7 ms 1788 KB
ansyes2 7 ms 1788 KB
ansyes3 7 ms 1788 KB
ansyes4 7 ms 1788 KB
example0 7 ms 1788 KB
example1 7 ms 1788 KB
example2 7 ms 1788 KB
example3 7 ms 1788 KB
example4 7 ms 1788 KB