Advertisement
jbn6972

Untitled

Oct 11th, 2022
733
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. #Code Written by : John Nixon
  2. #Date: 11:10:2022  Time: 13:08:18
  3. #Copyrights are applicable
  4. import sys
  5. import os
  6. sys.setrecursionlimit(10000)
  7. try:
  8.     sys.stdin = open('./input.txt', 'r')
  9.     sys.stdout = open('./output.txt', 'w')
  10. except:
  11.     pass
  12.  
  13.  
  14. profit = []
  15. selling = []
  16. total = 0
  17. for _ in range(int(input())):
  18.    
  19.     a,x,y = map(float,input().split())
  20.     profit.append(a + (a * (x/100)))
  21.     selling.append(profit[-1] - (profit[-1] * (y/100)))
  22.     total += a
  23.  
  24. ans = int(total - sum(selling))
  25. if ans > 0 :
  26.     print("Loss",ans)
  27. else:
  28.     print("Profit",abs(ans))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement