The closest pair of points problem is a well-known problem of computational geometry. In this problem, there are n points p_1,p_2,…,p_n in the Euclidean plane. You will be given q queries. In the i-th query, you will be given two integers ℓ_i and r_i (1≤ℓ_i<r_i≤n). You need to find a pair of points (u,v) such that ℓ_i≤u\<v≤r_i and the Euclidean distance (x_u−x_v)2+(y_u−y_v)2 between point p_u and p_v is minimized.
The first line of the input contains two integers n and q (2≤n≤250,000, 1≤q≤250,000), denoting the number of points and the number of queries.
In the next n lines, the i-th line contains two integers x_i and y_i (1≤x_i,y_i≤108), describing the coordinates of p_i.
Each of the next q lines contains two integers ℓ_i and r_i (1≤ℓ_i<r_i≤n), denoting a query.
For each query, print a single line containing an integer, denoting the value of (x_u−x_v)2+(y_u−y_v)2.