{"trustable":false,"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":"我们定义十进制数x的权值为f(x) \u003d a(n)*2^(n-1)+a(n-1)*2(n-2)+...a(2)*2+a(1)*1,a(i)表示十进制数x中第i位的数字。\n\n 题目给出a,b,求出0~b有多少个权值不大于f(a)的数。"}},{"title":"Input","value":{"format":"HTML","content":"The first line has a number T (T \u0026lt;\u003d 10000) , indicating the number of test cases. \n\u003cbr\u003eFor each test case, there are two numbers A and B (0 \u0026lt;\u003d A,B \u0026lt; 10 \n\u003csup\u003e9\u003c/sup\u003e)"}},{"title":"Output","value":{"format":"HTML","content":"For every case,you should output \"Case #t: \" at first, without quotes. The \n\u003ci\u003et\u003c/i\u003e is the case number starting from 1. Then output the answer."}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3\n0 100\n1 10\n5 100\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase #1: 1\nCase #2: 2\nCase #3: 13\u003c/pre\u003e"}}]}