{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n Everyone in the HDU knows that the number of boys is larger than the number of girls. But now, every boy wants to date with pretty girls. The girls like to date with the boys with higher IQ. In order to test the boys \u0027 IQ, The girls make a problem, and the boys who can solve the problem \n \u003cbr\u003ecorrectly and cost less time can date with them. \n \u003cbr\u003eThe problem is that : give you n positive integers and an integer k. You need to calculate how many different solutions the equation x + y \u003d k has . x and y must be among the given n integers. Two solutions are different if x0 !\u003d x1 or y0 !\u003d y1. \n \u003cbr\u003eNow smart Acmers, solving the problem as soon as possible. So you can dating with pretty girls. How wonderful! \n \u003cbr\u003e \n \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/4e177c0668aebf83429bc52069e1d84a?v\u003d1601036882\"\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contain an integer T. Then T cases followed. Each case begins with two integers n(2 \u0026lt;\u003d n \u0026lt;\u003d 100000) , k(0 \u0026lt;\u003d k \u0026lt; 2^31). And then the next line contain n integers."}},{"title":"Output","value":{"format":"HTML","content":"For each cases,output the numbers of solutions to the equation."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n5 4\n1 2 3 4 5\n8 8\n1 4 5 7 8 9 2 6\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e3\n5\u003c/pre\u003e"}}]}