{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"你有一个点的集合,x1,x2,xn;二个点是匹配的满足1:i,j没有被匹配过,2:|xi-xj|\u003e\u003dz;给n个点最多有多少组匹配"}},{"title":"Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e\nThe first line contains two integers n and z (2≤n≤2⋅10^5, 1≤z≤10^9) — the number of points and the constraint on the distance between matched points, respectively.\n\nThe second line contains n integers x1, x2, ..., xn (1≤xi≤10^9).\n\u003c/pre\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Print one integer — the maximum number of pairs of points you can match with each other."}},{"title":"Examples","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e\n4 2\n1 3 3 7\n2\n\n5 5\n10 9 5 8 7\n1\n\u003c/pre\u003e"}},{"title":"Note","value":{"format":"HTML","content":""}}]}