Submission #3352713

Source Code Expand

Copy
N, M = gets.split.map(&:to_i)

divs = []
i = 1
while i*i <= M
    divs.push(i, M/i) if M % i == 0
    i += 1
end
puts divs.select{|d| d*N <= M}.max

Submission Info

Submission Time
Task D - Partition
User betrue12
Language Ruby (2.3.3)
Score 400
Code Size 155 Byte
Status
Exec Time 9 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
All 400 / 400 0_small_1, 0_small_2, 0_small_3, 1_large_1, 1_large_2, 1_large_3, 1_large_4, 1_large_5, 1_large_6, 1_large_7, 2_max_1, 2_max_2, 3_prime_1, 3_prime_10, 3_prime_11, 3_prime_2, 3_prime_3, 3_prime_4, 3_prime_5, 3_prime_6, 3_prime_7, 3_prime_8, 3_prime_9, 4_hand_1, 4_hand_2, 4_hand_3, 4_hand_4, sample_01, sample_02, sample_03
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_small_1 7 ms 1788 KB
0_small_2 7 ms 1788 KB
0_small_3 7 ms 1788 KB
1_large_1 9 ms 1788 KB
1_large_2 9 ms 1788 KB
1_large_3 9 ms 1788 KB
1_large_4 8 ms 1788 KB
1_large_5 8 ms 1788 KB
1_large_6 7 ms 1788 KB
1_large_7 9 ms 1788 KB
2_max_1 9 ms 1788 KB
2_max_2 8 ms 1788 KB
3_prime_1 9 ms 1788 KB
3_prime_10 8 ms 1788 KB
3_prime_11 8 ms 1788 KB
3_prime_2 9 ms 1788 KB
3_prime_3 9 ms 1788 KB
3_prime_4 8 ms 1788 KB
3_prime_5 8 ms 1788 KB
3_prime_6 8 ms 1788 KB
3_prime_7 7 ms 1788 KB
3_prime_8 9 ms 1788 KB
3_prime_9 9 ms 1788 KB
4_hand_1 9 ms 1788 KB
4_hand_2 7 ms 1788 KB
4_hand_3 9 ms 1788 KB
4_hand_4 7 ms 1788 KB
sample_01 7 ms 1788 KB
sample_02 7 ms 1788 KB
sample_03 9 ms 1788 KB