ACM problems in Ruby