{"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\"\u003e 单身!\u003cbr\u003e 依然单身!\u003cbr\u003e 吉哥依然单身!\u003cbr\u003e DS级码农吉哥依然单身!\u003cbr\u003e 所以,他生平最恨情人节,不管是214还是77,他都讨厌!\u003cbr\u003e \u003cbr\u003e 吉哥观察了214和77这两个数,发现:\u003cbr\u003e 2+1+4\u003d7\u003cbr\u003e 7+7\u003d7*2\u003cbr\u003e 77\u003d7*11\u003cbr\u003e 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!\u003cbr\u003e\u003cbr\u003e 什么样的数和7有关呢?\u003cbr\u003e\u003cbr\u003e 如果一个整数符合下面3个条件之一,那么我们就说这个整数和7有关——\u003cbr\u003e 1、整数中某一位是7;\u003cbr\u003e 2、整数的每一位加起来的和是7的整数倍;\u003cbr\u003e 3、这个整数是7的整数倍;\u003cbr\u003e\u003cbr\u003e 现在问题来了:吉哥想知道在一定区间内和7无关的数字的平方和。\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"输入数据的第一行是case数T(1 \u0026lt;\u003d T \u0026lt;\u003d 50),然后接下来的T行表示T个case;每个case在一行内包含两个正整数L, R(1 \u0026lt;\u003d L \u0026lt;\u003d R \u0026lt;\u003d 10^18)。\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"请计算[L,R]中和7无关的数字的平方和,并将结果对10^9 + 7 求模后输出。"}},{"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\u003e3\r\n1 9\r\n10 11\r\n17 17\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e236\r\n221\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}