Submission #2849231


Source Code Expand

Copy
T = gets.to_i
T.times do
    a, b, c, d = gets.split.map(&:to_i)
    if a < b || b > d
        puts 'No'
    else
        gcd = b.gcd(d)
        rem = a % gcd
        min = (c-rem)/gcd*gcd + gcd + rem
        puts min >= b ? 'Yes' : 'No'
    end
end

Submission Info

Submission Time
Task B - rng_10s
User betrue12
Language Ruby (2.3.3)
Score 600
Code Size 260 Byte
Status
Exec Time 9 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example_0, example_1
All 600 / 600 example_0, example_1, multi_0, multi_1, multi_2
Case Name Status Exec Time Memory
example_0 7 ms 1788 KB
example_1 7 ms 1788 KB
multi_0 9 ms 1788 KB
multi_1 9 ms 1788 KB
multi_2 9 ms 1788 KB