mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-25 13:03:44 +03:00
26 lines
389 B
Python
Vendored
26 lines
389 B
Python
Vendored
with open("26.txt") as f:
|
|
data = f.read().splitlines()
|
|
|
|
n = int(data[0])
|
|
|
|
re = []
|
|
|
|
for l in data[1:]:
|
|
h, w, d, a = l.split()
|
|
|
|
re.append((int(h) * int(w) * int(d) / 8 / 1024 / 1024, a == "C" and 2 ** int(d) > 256))
|
|
|
|
re.sort()
|
|
|
|
ss = 0
|
|
c = 0
|
|
|
|
for e, a in re:
|
|
if n > e:
|
|
c += 1
|
|
if a:
|
|
ss += 1
|
|
n -= e
|
|
print(c, ss)
|
|
|