6900.Maximum Manhattan Distances

Time Limit: 1s Memory Limit: 512MB

A set is initially empty and $n$ points are added to it. Calculate the maximum Manhattan distance of two points after each addition.

Input Format(From the terminal/stdin)

The first line has an integer $n$ : the number of points.

The following $n$ lines describe the points. Each line has two integers $x$ and $y$ . You can assume that each point is distinct.

  • $1 \le n \le 2 \cdot 10^5$
  • $-10^9 \le x, y \le 10^9$

Output Format(To the terminal/stdout)

After each addition, print the maximum distance.

Sample Input

Copy
5
1 1
3 2
2 4
2 1
4 5
 \n
 · \n
 · \n
 · \n
 · \n
 · \n

Sample Output

Copy
0
3
4
4
7
 \n
 \n
 \n
 \n
 \n
Source: CSES, Geometry, 3410

Submit

请先 登录

© 2025 FAQs