The three rules of Ruby Q.:
Please do not post any solutions or spoiler discussion for this quiz
48 hours have passed from the time on this message.
Support Ruby Q. by submitting ideas as often as you can:
Suggestion: A [QUIZ] in the subject of emails about the problem helps
on Ruby T. follow the discussion.
You, and your trusty band of adventurers, have stumbled upon a hidden
rubies! (What luck, eh?) Not all gems are created equal, so you sneak
home and take your time evaluating the stones. The find was an equal
and you’re all horribly greedy, so you must find a fair system for
This week’s Ruby Q. is to write a program that fairly divides
The first command-line argument to the program will be the number of
All other arguments are the numerical values of treasures found. You’re
should output a fair split of the treasures, if possible, or a warning
if a fair split cannot be found.
$ ruby loot.rb 3 1 2 3 4 It is not possible to fairly split this treasure 3 ways. $ ruby loot.rb 2 9 12 14 17 23 32 34 40 42 49 1: 9 12 32 34 49 2: 14 17 23 40 42