class RandomSequence
def initialize(limit,num)
@limit,@num = limit,num
end
def each
@num.times { yield (rand * @limit).floor }
end
end
i = 15
RandomSequence.new(10,4).each do |num|
i = num if i < num
end
print i
Y2xhc3MgUmFuZG9tU2VxdWVuY2UKICBkZWYgaW5pdGlhbGl6ZShsaW1pdCxudW0pCiAgICBAbGltaXQsQG51bSA9IGxpbWl0LG51bQogIGVuZAogIAogIGRlZiBlYWNoCiAgICBAbnVtLnRpbWVzIHsgeWllbGQgKHJhbmQgKiBAbGltaXQpLmZsb29yIH0KICBlbmQKZW5kCiAKaSA9IDE1ClJhbmRvbVNlcXVlbmNlLm5ldygxMCw0KS5lYWNoIGRvIHxudW18CiAgaSA9IG51bSBpZiBpIDwgbnVtCmVuZApwcmludCBp