{"problem":{"name":"Ex - Enumerate Pairs","description":{"content":"Given are $N$ pairs of integers $(x_i,y_i)$, numbered $1$ to $N$, and an integer $K$.   List all pairs of integers $(p,q)$ that satisfy the conditions below, in the format specified in Output. *   $1","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc234_h"},"statements":[{"statement_type":"Markdown","content":"Given are $N$ pairs of integers $(x_i,y_i)$, numbered $1$ to $N$, and an integer $K$.  \nList all pairs of integers $(p,q)$ that satisfy the conditions below, in the format specified in Output.\n\n*   $1 \\le p < q \\le N$\n*   $\\sqrt{(x_p-x_q)^2+(y_p-y_q)^2} \\le K$\n\nHere, it is guaranteed that there are at most $4 \\times 10^5$ such pairs of integers.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\le N \\le 2 \\times 10^5$\n*   $1 \\le K \\le 1.5 \\times 10^9$\n*   $0 \\le x_i,y_i \\le 10^9$\n*   There are at most $4 \\times 10^5$ pairs of integers that should be listed.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n$x_1$ $y_1$\n$x_2$ $y_2$\n$\\vdots$\n$x_N$ $y_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc234_h","tags":[],"sample_group":[["6 5\n2 0\n2 2\n3 4\n0 0\n5 5\n8 3","9\n1 2\n1 3\n1 4\n2 3\n2 4\n2 5\n3 4\n3 5\n5 6\n\nThere are $9$ pairs of integers that satisfy the conditions, which should be printed in the specified format.  \n$(1,2),(1,3),(1,4),(2,3),(2,4),(2,5),(3,4),(3,5),(5,6)$"],["2 1414213562\n0 0\n1000000000 1000000000","0\n\nThere may be zero pairs of integers that satisfy the conditions."],["10 150\n300 300\n300 400\n300 500\n400 300\n400 400\n400 400\n400 500\n500 300\n500 400\n500 500","29\n1 2\n1 4\n1 5\n1 6\n2 3\n2 4\n2 5\n2 6\n2 7\n3 5\n3 6\n3 7\n4 5\n4 6\n4 8\n4 9\n5 6\n5 7\n5 8\n5 9\n5 10\n6 7\n6 8\n6 9\n6 10\n7 9\n7 10\n8 9\n9 10\n\nThere may be pairs of integers $(i,j)$ ($i < j$) such that $x_i=x_j$ and $y_i=y_j$."]],"created_at":"2026-03-03 11:01:14"}}