## TLE '17 Contest 3 P1 - Willson and Territory

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M
Author:

Problem type

This is Willson's territory! Note his territorial markings.

Willson the Canada Goose is like any other Canada Goose - he can be territorial at times, especially to unfamiliar geese and unsuspecting humans.

Having just arrived in California for the first time, Willson's family decides to rest at the point . Willson walks around the area and finds points of interest. The point is .

Willson can only waddle horizontally or vertically. He determines that his territory consists of any point that requires no more than units of waddling from his family's resting point, where is the maximum number of units of waddling required from the resting point to a point of interest.

Willson wants to know the area of his territory, so he knows how much "territorial markings" he will need to use. Can you help him?

#### Input Specification

The first line of input will contain two space-separated integers, and .

The next line of input will contain a single integer, .

lines of input follow. The line will contain two space-separated integers, and .

All coordinates satisfy .

#### Output Specification

Output a single integer, the area of Willson's territory. If your answer is not an integer, round it to the nearest one.

#### Sample Input

0 1
4
1 1
2 1
1 0
1 -1

#### Sample Output

18

• bsef16m027  commented on March 18, 2018, 8:30 a.m.

where is 'k' in the input?

• aeternalis1  commented on March 18, 2018, 4:31 p.m.

is the maximum number of units of waddling required from the resting point to a point of interest.

It isn't directly in the input, but implied.