#K66077. Maximum Delivery Charge

    ID: 32340 Type: Default 1000ms 256MiB

Maximum Delivery Charge

Maximum Delivery Charge

You are given the coordinates of a restaurant's central facility and a list of delivery zones. The delivery charge is computed as the Manhattan distance between the restaurant and a delivery zone. The Manhattan distance between two points \( (x_1, y_1) \) and \( (x_2, y_2) \) is given by \( |x_1 - x_2| + |y_1 - y_2| \). Your task is to calculate the maximum delivery charge applicable among all the delivery zones.

Input Format:

  • The first line contains two integers, \( x_r \) and \( y_r \), representing the coordinates of the restaurant's central facility.
  • The second line contains a single integer \( n \), denoting the number of delivery zones.
  • The following \( n \) lines each contain two integers, representing the coordinates \( (x, y) \) of a delivery zone.

Output Format:

  • Output a single integer, which is the maximum delivery charge from the restaurant to any delivery zone.

Example:

Input:
0 0
5
3 4
1 1
-2 -3
4 -1
0 5

Output: 7

</p>

inputFormat

The input is given through standard input (stdin) in the following format:

  • Line 1: Two space-separated integers \( x_r \) and \( y_r \) — the coordinates of the restaurant's central facility.
  • Line 2: A single integer \( n \) — the number of delivery zones.
  • Next \( n \) lines: Each line contains two space-separated integers \( x \) and \( y \) representing the coordinates of a delivery zone.

outputFormat

Output a single integer representing the maximum delivery charge (i.e., maximum Manhattan distance) from the restaurant to any delivery zone. This should be printed to standard output (stdout).

## sample
0 0
5
3 4
1 1
-2 -3
4 -1
0 5
7