{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eMr W likes interval counting.\u003cbr\u003e\u003cbr\u003eOne day,Mr W constructed a sequence of length $n$, each position of this sequence has a weight $c$ ($c\\leq n$).\u003cbr\u003e\u003cbr\u003eThere are a total of $Q$ queries, and each query is given an interval $(l, r)$ and two parameters $a$, $b$, and ask how many $\\ kinds \\ of \\ weights\\ $of this interval satisfy$\\ \\ c \\bigoplus a \\leq b\\ \\ $ where $\\bigoplus$ is the binary Bitwise XOR operation. \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There is only one test case for this question.\u003cbr\u003e\u003cbr\u003eIn the first line contains a positive integer $n$ ($n \\leq 100000$) represents the length of the sequence.\u003cbr\u003e\u003cbr\u003eIn the second line contains n positive integers, The i-th number in the sequence represents the weight $c_i$ ($1 \\leq c_i \\leq n$)of the i-th position.\u003cbr\u003e\u003cbr\u003eIn the third line, a positive integer $Q$ ($Q \\leq 100000$) represents the number of queries.\u003cbr\u003e\u003cbr\u003eIn the next Q line, each line has four positive integers $l$, $r$, $a$, $b$ ($1 \\leq l \\leq r \\leq n, a \\leq n+1,b \\leq n+1$), which represent the parameters of the query."}},{"title":"Output","value":{"format":"HTML","content":"For each query, output an integer on a line to represent the number of weights that meet the conditions. "}},{"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\u003e5\r\n1 2 2 4 5\r\n4\r\n1 3 1 3\r\n2 4 4 2\r\n1 5 2 3\r\n4 5 3 6\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1\r\n2\r\n1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}