Advertisement
Spocoman

01. Black Flag

Nov 10th, 2023
795
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. days = int(input())
  2. daily_plunder = int(input())
  3. expected_plunder = float(input())
  4. total_plunder = 0.0
  5.  
  6. for i in range(1, days + 1):
  7.     total_plunder += daily_plunder
  8.     if i % 3 == 0:
  9.         total_plunder += daily_plunder * 0.5
  10.     if i % 5 == 0:
  11.         total_plunder *= 0.7
  12.  
  13. if total_plunder >= expected_plunder:
  14.     print(f"Ahoy! {total_plunder:.2f} plunder gained.")
  15. else:
  16.     print(f"Collected only {total_plunder / expected_plunder * 100:.2f}% of the plunder.")
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement