Advertisement
daegron

2

Nov 2nd, 2021
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. def sol(table_sorted, n):
  2.  
  3.     Wt, Ht = table_sorted[0], table_sorted[1]
  4.     price = float("infinity")
  5.  
  6.     for i in range(n):
  7.  
  8.         cloth = [int(i) for i in input().split()]
  9.         Wc, Hc = min(cloth[0], cloth[1]), max(cloth[0], cloth[1])
  10.        
  11.         if Wc >= Wt and Hc >= Ht:
  12.             price = min(price, cloth[2])
  13.  
  14.     return price
  15.  
  16.  
  17. n = int(input())
  18. print(sol(sorted(tuple([int(i) for i in input().split()])), n))
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement