Advertisement
Spocoman

10. Profit

Jan 2nd, 2022
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. one_bgn_count = int(input())
  2. two_bgn_count = int(input())
  3. three_bgn_count = int(input())
  4. total = int(input())
  5.  
  6. for i in range(0, one_bgn_count + 1):
  7.     for j in range(0, two_bgn_count + 1):
  8.         for k in range(0, three_bgn_count + 1):
  9.             if i * 1 + j * 2 + k * 5 == total:
  10.                 print(f'{i} * 1 lv. + {j} * 2 lv. + {k} * 5 lv. = {total} lv.')
  11.  
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement