Advertisement
Guest User

Untitled

a guest
Dec 27th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. 8. * Legendary Farming
  2. 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. The possible items are:
  3. • Shadowmourne – requires 250 Shards;
  4. • Valanyr – requires 250 Fragments;
  5. • Dragonwrath – requires 250 Motes;
  6. Shards, Fragments and Motes are the key materials, all else is junk. You will be given lines of input, such as
  7. 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. 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.
  8. Input
  9. • Each line of input is in format {quantity} {material} {quantity} {material} … {quantity} {material}
  10. Output
  11. • On the first line, print the obtained item in format {Legendary item} obtained!
  12. • On the next three lines, print the remaining key materials in descending order by quantity
  13. o If two key materials have the same quantity, print them in alphabetical order
  14. • On the final several lines, print the junk items in alphabetical order
  15. o All materials are printed in format {material}: {quantity}
  16. o All output should be lowercase, except the first letter of the legendary
  17. Constraints
  18. • The quantity-material pairs are between 1 and 25 per line.
  19. • The number of lines is in range [1..10]
  20. • All materials are case-insensitive.
  21. • Allowed working time: 0.25s
  22. • Allowed memory: 16 MB
  23. Examples
  24. Input Output
  25. 3 Motes 5 stones 5 Shards
  26. 6 leathers 255 fragments 7 Shards Valanyr obtained!
  27. fragments: 5
  28. shards: 5
  29. motes: 3
  30. leathers: 6
  31. stones: 5
  32.  
  33. Input Output
  34. 123 silver 6 shards 8 shards 5 motes
  35. 9 fangs 75 motes 103 MOTES 8 Shards
  36. 86 Motes 7 stones 19 silver Dragonwrath obtained!
  37. shards: 22
  38. motes: 19
  39. fragments: 0
  40. fangs: 9
  41. silver: 123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement