DialOG_

Untitled

Jan 24th, 2021
672
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. with open('4task.txt','r') as f:
  2.     text = f.read()
  3.  
  4. lines = text.split('\n')
  5. tovar = int(lines[0].split()[0])
  6. sale = int(lines[0].split()[1])
  7.  
  8. del lines[0]
  9. del lines[-1]
  10. nums = []
  11. for i in lines:
  12.     nums.append(int(i))
  13.  
  14.    
  15. nums.sort()
  16.  
  17.  
  18. delta = tovar - sale
  19. s = 0
  20. for i in range(delta,tovar):
  21.     s += int(nums[i]*0.2)
  22.  
  23.  
  24. print(s, nums[delta-1])
  25.  
RAW Paste Data