{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGiven two non-negative integers $$$X$$$ and $$$Y$$$, determine the value of $$$$$$ \\sum_{i\u003d0}^{X}\\sum_{j\u003d[i\u003d0]}^{Y}[i\\\u0026amp;j\u003d0]\\lfloor\\log_2(i+j)+1\\rfloor $$$$$$ modulo $$$10^9+7$$$ where \u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$\\\u0026amp;$$$ denotes bitwise AND; \u003c/li\u003e\u003cli\u003e $$$[A]$$$ equals 1 if $$$A$$$ is true, otherwise $$$0$$$; \u003c/li\u003e\u003cli\u003e $$$\\lfloor x\\rfloor$$$ equals the maximum integer whose value is no more than $$$x$$$. \u003c/li\u003e\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer $$$T\\,(1\\le T \\le 10^5)$$$ denoting the number of test cases.\u003c/p\u003e\u003cp\u003eEach of the following $$$T$$$ lines contains two integers $$$X, Y\\,(0\\le X,Y \\le 10^9)$$$ indicating a test case.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print one line containing one integer, the answer to the test case.\u003c/p\u003e"}},{"title":"Examples","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\u003e3\n3 3\n19 26\n8 17\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e14\n814\n278\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eFor the first test case: \u003c/p\u003e\u003cul\u003e \u003cli\u003e Two $$$(i,j)$$$ pairs increase the sum by 1: $$$(0, 1), (1, 0)$$$ \u003c/li\u003e\u003cli\u003e Six $$$(i,j)$$$ pairs increase the sum by 2: $$$(0, 2), (0, 3), (1, 2), (2, 0), (2, 1), (3, 0)$$$ \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eSo the answer is $$$1\\times 2 + 2\\times 6 \u003d 14$$$.\u003c/p\u003e"}}]}