Gigasecond exercise in Ruby