Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(a, b): #a, b - кол-во кубометров, к-рые продаём
- return 16 * a + 33 * b
- def var1(a, b):
- nat = min(a, 2200)
- liq = min(b, 3500)
- return f(nat, liq)
- def var2(a, b):
- nat = min(a, 3800)
- liq = min(b, 2450)
- return f(nat, liq)
- def worse(a, b):
- v1 = var1(a, b)
- v2 = var2(a, b)
- return min(v1, v2)
- var = [
- [4032, 2970],
- [3032, 2954],
- [578, 1970],
- [3132, 2854]
- ]
- res = []
- for a in var:
- now = (f(a[0], a[1]), a)
- res.append(now)
- print(res)
- res = sorted(res)
- res = res[::-1]
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement