{"trustable":true,"sections":[{"title":"Background","value":{"format":"MD","content":"Setting problems is a painful task!\n\nSeeing the same problems over and over again can lead to aesthetic fatigue. So I abandoned the familiar A+B Problem and switched to A-B, haha!"}},{"title":"Description","value":{"format":"MD","content":"Given a sequence of positive integers and a positive integer $C$, calculate the number of pairs of numbers that satisfy $A - B \u003d C$ (pairs with the same number at different positions are considered different pairs)."}},{"title":"Input","value":{"format":"MD","content":"The input consists of two lines.\n\nThe first line contains two positive integers $N,C$.\n\nThe second line contains $N$ positive integers, which are the sequence to be processed."}},{"title":"Output","value":{"format":"MD","content":"Output a single line indicating the number of pairs in the sequence of positive integers that satisfy $A - B \u003d C$."}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4 1\n1 1 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Hint","value":{"format":"MD","content":"For the data of $75\\%$, $1 \\leq N \\leq 2000$.\n\nFor the data of $100\\%$, $1 \\leq N \\leq 2 \\times 10^5$, $0 \\leq a_i \u003c2^{30}$, $1 \\leq C \u003c 2^{30}$.\n\nTwo additional data sets added on April 29, 2017."}}]}