{"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\"\u003eLet’s play a game.We add numbers 1,2...n in increasing order from 1 and put them into some sets.\u003cbr\u003eWhen we add i,we must create a new set, and put iinto it.And meanwhile we have to bring [i-lowbit(i)+1,i-1] from their original sets, and put them into the new set,too.When we put one integer into a set,it costs us one unit physical strength. But bringing integer from old set does not cost any physical strength.\u003cbr\u003eAfter we add 1,2...n,we have q queries now.There are two different kinds of query:\u003cbr\u003e1 L R:query the cost of strength after we add all of [L,R](1≤L≤R≤n)\u003cbr\u003e2 x:query the units of strength we cost for putting x(1≤x≤n) into some sets.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several cases,process till end of the input.\u003cbr\u003eFor each case,the first line contains two integers n and q.Then q lines follow.Each line contains one query.The form of query has been shown above.\u003cbr\u003en≤10^18,q≤10^5\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each query, please output one line containing your answer for this query"}},{"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 2\r\n1 8 9\r\n2 6\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e9\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cbr\u003elowbit(i) \u003di\u0026amp;(-i).It means the size of the lowest nonzero bits in binary of i. For example, 610\u003d1102, lowbit(6) \u003d102\u003d 210\u003cbr\u003eWhen we add 8,we should bring [1,7] and 8 into new set.\u003cbr\u003eWhen we add 9,we should bring [9,8] (empty) and 9 into new set.\u003cbr\u003eSo the first answer is 8+1\u003d9.\u003cbr\u003eWhen we add 6 and 8,we should put 6 into new sets.\u003cbr\u003eSo the second answer is 2. \u003cbr\u003e"}}]}