{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"给一个非降序排列的整数数组a,你的任务是对于一系列询问(i, j),回答ai,ai+1...aj中次数出现最多的值所出现的次数。"}},{"title":"Input","value":{"format":"HTML","content":"输入包含多组输入。每组数据第一行为两个整数n和q(1\u003c\u003dn,q\u003c\u003d100000)。第二行包括n个非降序排列的整数a1,a2,....,an(-100000\u003c\u003dai\u003c\u003d100000)。以下q行每行包含两个整数i和j(1\u003c\u003di\u003c\u003dj\u003c\u003dn),输入结束标志为n\u003d0"}},{"title":"Output","value":{"format":"HTML","content":"对于每个查询,输出查询结果"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e10 3\n-1 -1 1 1 1 1 3 10 10 10\n2 3\n1 10\n5 10\n0\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e1\n4\n3\n\u003c/pre\u003e"}}]}