{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Given an array of **N** integers indexed from **1** to **N**, and **q** queries, each in the form **i j**, you have to find the number of distinct integers from index **i** to **j** (inclusive)."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 5)**, denoting the number of test cases.\n\nThe first line of a case is a blank line. The next line contains two integers **N (1 \u0026le; N \u0026le; 10\u003csup\u003e5\u003c/sup\u003e)**, **q (1 \u0026le; q \u0026le; 50000)**. The next line contains **N** space separated integers forming the array. There integers range in **[0, 10\u003csup\u003e5\u003c/sup\u003e]**.\n\nEach of the next **q** lines will contain a query which is in the form **i j (1 \u0026le; i \u0026le; j \u0026le; N)**."}},{"title":"Output","value":{"format":"MD","content":"For each test case, print the case number in a single line. Then for each query you have to print a line containing number of distinct integers from index **i** to **j**."}},{"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\n\n8 5\n1 1 1 2 3 5 1 2\n1 8\n2 3\n3 6\n4 5\n4 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1:\n4\n1\n4\n2\n4\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."}}]}