BdW44222

01.Black Flag

Jul 8th, 2021
753
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. plunder_days = int(input())
  2. daily_plunder = int(input())
  3. expected_plunder = float(input())
  4. gained_plunder = 0
  5.  
  6.  
  7. for day in range(1, plunder_days + 1):
  8.     gained_plunder += daily_plunder
  9.  
  10.     if day % 3 == 0:
  11.         gained_plunder += daily_plunder * 0.50
  12.  
  13.     if day % 5 == 0:
  14.         gained_plunder -= (daily_plunder * 0.30)
  15.  
  16.  
  17. if gained_plunder >= expected_plunder:
  18.     print(f"Ahoy! {gained_plunder:.2f} plunder gained.")
  19. else:
  20.     percentage = gained_plunder / expected_plunder * 100
  21.     print(f"Collected only {percentage:.2f}% of the plunder.")
  22.  
RAW Paste Data