def indivArea(someList):
    return someList[0] * someList[1]


n = int(input())
pieces = int(input())
print(sum([indivArea([int(i) for i in input().split()]) for i in range(
    pieces)]) // n)

810803cb891dcc485af45bbb1eda9b00e0d15365
<mask token>

def indivArea(someList):
    return someList[0] * someList[1]


<mask token>

def indivArea(someList):
    return someList[0] * someList[1]


<mask token>
print(sum([indivArea([int(i) for i in input().split()]) for i in range(
    pieces)]) // n)

def indivArea(someList):
    return someList[0] * someList[1]


n = int(input())
pieces = int(input())
print(sum([indivArea([int(i) for i in input().split()]) for i in range(
    pieces)]) // n)
