Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # this code should take a candy-amount C and mouth-size M
- # then print the quickest way to eat all the candies
- # so if 10 candies, mouthsize 3, the output should be 3 3 3 1
- C,M=gets.split(" ").collect {|x| x.to_i}
- while C>M
- print "%d " % [M]
- C=C-M
- end
- print C
Advertisement
Add Comment
Please, Sign In to add comment