You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
434 B
12 lines
434 B
#!/usr/bin/env python3
|
|
|
|
from sys import stdin
|
|
data = [(range(int(a1), int(a2)+1), range(int(b1), int(b2)+1))
|
|
for (a1, a2), (b1, b2) in [(a.split("-"), b.split("-"))
|
|
for a, b in [x.split(",") for x in stdin.readlines()]]]
|
|
print(sum(all(x in b for x in a) or all(x in a for x in b) for a, b in data))
|
|
print(sum(bool(set(a) & set(b)) for a, b in data))
|
|
|
|
for a, b in data:
|
|
if set(a) & set(b):
|
|
print((a,b))
|
|
|