fork download
  1. # SID/Name : Alika Siti Almubdi
  2. # Date : 28/9/2026
  3. # Description : Problem 2
  4.  
  5. coins = int(input("Enter the total gold coins: "))
  6. mythic = int(input("Enter the price of a Mythic Chest: "))
  7. epic = int(input("Enter the price of an Epic Chest: "))
  8. rare = int(input("Enter the price of a Rare Chest: "))
  9.  
  10. mythic_chest = coins // mythic
  11. coins = coins % mythic
  12.  
  13. epic_chest = coins // epic
  14. coins = coins % epic
  15.  
  16. rare_chest = coins // rare
  17. coins = coins % rare
  18.  
  19. total_value = (mythic_chest * mythic) + (epic_chest * epic) + (rare_chest * rare)
  20.  
  21. print("Mythic Chests:", mythic_chest)
  22. print("Epic Chests:", rare_chest)
  23. print("Rare Chests:", rare_chest)
  24. print("Leftover gold coins:", coins)
  25. print("Total value of coins in chest:", total_value)
Success #stdin #stdout 0.1s 14132KB
stdin
1875
500
100
20
stdout
Enter the total gold coins: Enter the price of a Mythic Chest: Enter the price of an Epic Chest: Enter the price of a Rare Chest: Mythic Chests: 3
Epic Chests: 3
Rare Chests: 3
Leftover gold coins: 15
Total value of coins in chest: 1860