Guest User

Untitled

a guest
Jul 18th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1.  
  2. 10. *Legendary Farming
  3. You’ve beaten all the content and the last thing left to accomplish is own a legendary item. However, it’s a tedious process and requires quite a bit of farming. Anyway, you are not too pretentious – any legendary will do.
  4.  
  5. The possible items are:
  6. Shadowmourne – requires 250 Shards;
  7. Valanyr – requires 250 Fragments;
  8. Dragonwrath – requires 250 Motes;
  9.  
  10. Shards, Fragments and Motes are the key materials, all else is junk.
  11.  
  12. You will be given as a string, such as 2 motes 3 ores 15 stones. Keep track of the key materials - the first that reaches the 250 mark wins the race. At that point, print the corresponding legendary obtained.
  13.  
  14. Then, print the remaining shards, fragments, motes, ordered by quantity in descending order, then by name in ascending order, each on a new line. Finally, print the collected junk items, in alphabetical order.
  15.  
  16. Input
  17. Input is a string in format {quantity} {material} {quantity} {material} … {quantity} {material}
  18.  
  19. Output
  20. On the first line, print the obtained item in format {Legendary item} obtained!
  21. On the next three lines, print the remaining key materials in descending order by quantity
  22. If two key materials have the same quantity, print them in alphabetical order
  23. On the final several lines, print the junk items in alphabetical order
  24. All materials are printed in format {material}: {quantity}
  25. All output should be lowercase, except the first letter of the legendary
  26.  
  27. Examples
  28.  
  29. Input
  30. '3 Motes 5 stones 5 Shards 6 leathers 255 fragments 7 Shards'
  31.  
  32. Output
  33. Valanyr obtained!
  34. fragments: 5
  35. shards: 5
  36. motes: 3
  37. leathers: 6
  38. stones: 5
  39.  
  40. Input
  41. '123 silver 6 shards 8 shards 5 motes 9 fangs 75 motes 103 MOTES 8 Shards 86 Motes 7 stones 19 silver'
  42.  
  43. Output
  44. Dragonwrath obtained!
  45. shards: 22
  46. motes: 19
  47. fragments: 0
  48. fangs: 9
  49. silver: 123
Add Comment
Please, Sign In to add comment