{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou are given a sequence of \u003cstrong\u003en\u003c/strong\u003e integers \u003cstrong\u003ea\u003csub\u003e1\u003c/sub\u003e , a\u003csub\u003e2\u003c/sub\u003e , ... , a\u003csub\u003en\u003c/sub\u003e\u003c/strong\u003e in non-decreasing order. In addition to that, you are given several queries consisting of indices \u003cstrong\u003ei\u003c/strong\u003e and \u003cstrong\u003ej\u003c/strong\u003e (\u003ci\u003e1 ≤ i ≤ j ≤ n\u003c/i\u003e). For each query, determine the most frequent value among the integers \u003cstrong\u003ea\u003csub\u003ei\u003c/sub\u003e , ... , a\u003csub\u003ej\u003c/sub\u003e\u003c/strong\u003e.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input consists of several test cases. Each test case starts with a line containing two integers \u003cstrong\u003en\u003c/strong\u003e and \u003cstrong\u003eq\u003c/strong\u003e (\u003ci\u003e1 ≤ n, q ≤ 100000\u003c/i\u003e). The next line contains \u003cstrong\u003en\u003c/strong\u003e integers \u003cstrong\u003ea\u003csub\u003e1\u003c/sub\u003e , ... , a\u003csub\u003en\u003c/sub\u003e\u003c/strong\u003e (\u003ci\u003e-100000 ≤ a\u003csub\u003ei\u003c/sub\u003e ≤ 100000\u003c/i\u003e, for each \u003ci\u003ei ∈ {1, ..., n}\u003c/i\u003e) separated by spaces. You can assume that for each \u003ci\u003ei ∈ {1, ..., n-1}: a\u003csub\u003ei\u003c/sub\u003e ≤ a\u003csub\u003ei+1\u003c/sub\u003e\u003c/i\u003e. The following \u003cstrong\u003eq\u003c/strong\u003e lines contain one query each, consisting of two integers \u003cstrong\u003ei\u003c/strong\u003e and \u003cstrong\u003ej\u003c/strong\u003e (\u003ci\u003e1 ≤ i ≤ j ≤ n\u003c/i\u003e), which indicate the boundary indices for the\r\u003cbr\u003equery.\u003c/p\u003e\u003cp\u003eThe last test case is followed by a line containing a single \u003ci\u003e0\u003c/i\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each query, print one line with one integer: The number of occurrences of the most frequent value within the given range.\u003c/p\u003e"}},{"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\u003e10 3\r\n-1 -1 1 1 1 1 3 10 10 10\r\n2 3\r\n1 10\r\n5 10\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n4\r\n3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}