PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000397. Hình vuông bao nhỏ nhất (Minimize Bounding Square)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Hình vuông bao nhỏ nhất (Minimize Bounding Square)

Minimize Bounding Square

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn points, point ii at (xi,yi)(x_i,y_i). One operation moves a chosen point one unit in one of four axis-parallel directions. Perform at most kk operations, possibly none. Points may coincide, including initially. Enclose all resulting points in or on an axis-aligned square. Find its minimum achievable side length, allowing zero if all points can coincide.

Input

The first line contains integers n,kn,k. The next nn lines each contain the initial integer coordinates xi,yix_i,y_i of point ii, in order.

Output

Print the minimum side length as an integer.

Subtasks

  • Subtask 1 (20 points): 1≤n≤201\le n\le 20; 0≤k≤4⋅10140\le k\le4\cdot10^{14}; 0≤xi,yi≤1090\le x_i,y_i\le10^9 for every 1≤i≤n1\le i\le n.
  • Subtask 2 (30 points): 1≤n≤20001\le n\le 2000; 0≤k≤4⋅10140\le k\le4\cdot10^{14}; 0≤xi,yi≤1090\le x_i,y_i\le10^9 for every 1≤i≤n1\le i\le n.
  • Subtask 3 (50 points): 1≤n≤2000001\le n\le 200000; 0≤k≤4⋅10140\le k\le4\cdot10^{14}; 0≤xi,yi≤1090\le x_i,y_i\le10^9 for every 1≤i≤n1\le i\le n.

Examples

Input

2 4
0 0
5 3

Output

2

Explanation

Move (5,3)(5,3) left three units and down one to (2,2)(2,2). Both points lie in [0,2]×[0,2][0,2]\times[0,2]. Side length 1 requires reducing the coordinate separations by at least 4 and 2, totaling 6 moves, exceeding 4.

Sample illustration