Advertisement
Korotkodul

dem23.n9

Jun 9th, 2023
793
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. ans = 0
  2. with open('N9.txt') as f:
  3.     lines = f.readlines()
  4.     for line in lines:
  5.         a = [int(i) for i in line.split()]
  6.         b = set(a)
  7.         if len(b) + 1 != len(a):
  8.             continue
  9.         rep=-1
  10.         for i in a:
  11.             if a.count(i) == 2:
  12.                 rep = i
  13.         S = sum(a) - 2 * rep
  14.         if S <= 4 * 2 * rep:
  15.             ans += 1
  16. print(ans)
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement