E. Выбор команд

public
yeskendir.sultanov Apr 26, 2024 Never 74
Clone
Python E.py 15 lines (11 loc) | 239 Bytes
1
n, k = map(int, input().split())
2
a = sorted([int(x) for x in input().split()])
3
4
cur = 0
5
cnt = 0
6
7
for x in a:
8
if x + k <= 5:
9
cur += 1
10
11
if cur == 3:
12
cnt += 1
13
cur = 0
14
15
print(cnt)
16
17