{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Given **n** points (1 dimensional) and **q** segments, you have to find the number of points that lie in each of the segments. A point **p\u003csub\u003ei\u003c/sub\u003e** will lie in a segment **A B** if **A \u0026le; p\u003csub\u003ei\u003c/sub\u003e \u0026le; B**.\n\nFor example if the points are **1, 4, 6, 8, 10**. And the segment is **0** to **5**. Then there are **2** points that lie in the segment.\n"}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 5)**, denoting the number of test cases.\n\nEach case starts with a line containing two integers **n (1 \u0026le; n \u0026le; 10\u003csup\u003e5\u003c/sup\u003e)** and **q (1 \u0026le; q \u0026le; 50000)**. The next line contains **n** space separated integers denoting the points in ascending order. All the integers are distinct and each of them range in **[0, 10\u003csup\u003e8\u003c/sup\u003e]**.\n\nEach of the next **q** lines contains two integers **A\u003csub\u003ek\u003c/sub\u003e B\u003csub\u003ek\u003c/sub\u003e (0 \u0026le; A\u003csub\u003ek\u003c/sub\u003e \u0026le; B\u003csub\u003ek\u003c/sub\u003e \u0026le; 10\u003csup\u003e8\u003c/sup\u003e)** denoting a segment.\n"}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number in a single line. Then for each segment, print the number of points that lie in that segment.\n"}},{"title":"Sample","value":{"format":"HTML","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\u003e1\n5 3\n1 4 6 8 10\n0 5\n6 10\n7 100000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\n2\n3\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"Dataset is huge, use faster I/O methods.\n"}}]}