{"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\"\u003eAs a cold-blooded, hot-blooded, and iron-blooded vampire, Shinobu likes to build segment trees.\u003cbr\u003e\u003cbr\u003eShe uses the $build()$ function to build a segment tree, and the process of building the segment tree will increase the value of some numbers.\u003cbr\u003e\u003cbr\u003eThe specific content of the $build()$ function is as follows:\u003cbr\u003e\u003cbr\u003e```\u003cbr\u003evoid build(int id, int l, int r){\u003cbr\u003e\u0026nbsp;\u0026nbsp;value[id] +\u003d r-l+1;\u003cbr\u003e\u0026nbsp;\u0026nbsp;if(l \u003d\u003d r) return;\u003cbr\u003e\u0026nbsp;\u0026nbsp;int mid \u003d (r+l)/2;\u003cbr\u003e\u0026nbsp;\u0026nbsp;build(id*2, l, mid);\u003cbr\u003e\u0026nbsp;\u0026nbsp;build(id*2+1, mid+1, r);\u003cbr\u003e\u0026nbsp;\u0026nbsp;return;\u003cbr\u003e}\u003cbr\u003e```\u003cbr\u003e\u003cbr\u003eFor example, if Shinobi calls $build(1,1,2)$ once, then $value[1]$ will increase by $2$, $value[2]$ and $value[3]$ will increase by $1$.\u003cbr\u003e\u003cbr\u003eIn the long life of a vampire, Shinobu builds a segment tree every day. She has been doing this since day $1$, and on the $i$-th day, she will call $build(1,1,i)$ to build a segment tree.\u003cbr\u003e\u003cbr\u003eAs a fan of Shinobi, playf got a fan number $x$. Now he wants to ask you a question: what the $value[x]$ will be at the end of the $n$-th day ?\u003cbr\u003e\u003cbr\u003eAttention: The initial value of all values is 0.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input contains a single integer $t(1 \\le t \\le 10^5)$ --- the number of test cases. \u003cbr\u003e\u003cbr\u003eEach of the next $t$ lines contains two integers $n, x(1 \\le n \\le 10^9, 1 \\le x \\le 4\\times n)$ --- playf\u0027s question."}},{"title":"Output","value":{"format":"HTML","content":"For each question, print one line contains one integer --- the answer to the $i$-th question."}},{"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\u003e7\r\n2 3\r\n3 3\r\n4 3\r\n26 49\r\n1000000000 4000000000\r\n1000000000 1\r\n11451419 19810\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\r\n4\r\n9\r\n0\r\n500000000500000000\r\n4004478229\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}