You are viewing a single comment's thread. Return to all comments →
Crazy 2-liner in Python 3. :D
n, m = map(int, input().split()) print(sum(map(lambda x, y, t: t * (y - x + 1), *zip(*(map(int, input().split()) for _ in range(m))))) // n)
Seems like cookies are disabled on this browser, please enable them to open this website
Filling Jars
You are viewing a single comment's thread. Return to all comments →
Crazy 2-liner in Python 3. :D