{"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\"\u003eMzry1992 got sick recently. He had to go to the hospital for treatment. The time in the hospital was very boring, so Mzry1992 designed a game and wanted to persuade the nurse to play with him.\u003cbr\u003eThe game is played as follows: There are n piles of candies on the table. Each pile has a certain number of candies. Mzry1992 and the nurse take turns to eat candies. As the designed of the game, Mzry1992 always starts first. When it\u0027s someone\u0027s turn to eat candies, he must select a pile of candies (suppose the pile has m candies now), and eat x(0 \u0026lt; x \u0026lt;\u003d \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/d6a03320dd8675d4dec6c19e2025f7e2?v\u003d1714632347\"\u003e ) candies. Otherwise, he loses the game.\u003cbr\u003e(\"\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/832b7a776be0012fa3161e947b1a2173?v\u003d1714632347\"\u003e\" indicates the largest integer which is not greater than x)\u003cbr\u003eThe nurse loved candies, so she agreed to play with Mzry1992. To start the game, they began to prepare n candy piles. After they had arranged the first n-1 piles of candies (where the number of candies in the ith pile was x\u003csub\u003ei\u003c/sub\u003e, 1 \u0026lt;\u003d i \u0026lt;\u003d n - 1), a new patient came in and the nurse had to go to take care of him. So Mzry1992 was left alone to decide the number of candies in the last pile.\u003cbr\u003eBut before the nurse left, she demanded that the last pile must have no less than L candies and no more than R candies, i.e. , L \u0026lt;\u003d x\u003csub\u003en\u003c/sub\u003e \u0026lt;\u003d R.\u003cbr\u003eMzry1992 agreed with the nurse\u0027s demand, since it would be unfair for the nurse if Mzry1992 could place any number of candies in the last pile. Now Mzry1992 wondered, if both he and the nurse play with their best strategies, how many different ways of placing candies in the last pile will make him lose?\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line has a number T (T \u0026lt;\u003d 20) , indicating the number of test cases.\u003cbr\u003eThen there comes the input of each test case.\u003cbr\u003eThe input of each test case has four lines.\u003cbr\u003eThe first line contains three integers A, B, and C(0 \u0026lt;\u003d A,B \u0026lt;\u003d 10\u003csup\u003e18\u003c/sup\u003e, 1 \u0026lt;\u003d C \u0026lt;\u003d 10\u003csup\u003e18\u003c/sup\u003e), which are defined above in the description.\u003cbr\u003eThe second line contains an integer n(1 \u0026lt;\u003d n \u0026lt;\u003d 10), indicating the number of candy piles.\u003cbr\u003eThe third line contains n - 1 integers x\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e, ... , x\u003csub\u003en-1\u003c/sub\u003e, where x\u003csub\u003ei\u003c/sub\u003e(1 \u0026lt;\u003d xi \u0026lt;\u003d 10\u003csup\u003e18\u003c/sup\u003e) indicates the number of candies in the i\u003csub\u003eth\u003c/sub\u003e pile.\u003cbr\u003eThe fourth line contains two integers L and R(1 \u0026lt;\u003d L \u0026lt;\u003d R \u0026lt;\u003d 10\u003csup\u003e18\u003c/sup\u003e), which constrains the number of the n\u003csub\u003eth\u003c/sub\u003e pile in the range [L, R], i.e., L \u0026lt;\u003d x\u003csub\u003en\u003c/sub\u003e \u0026lt;\u003d R.\u003cbr\u003eWe can guaranteed that at any time \u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/d6a03320dd8675d4dec6c19e2025f7e2?v\u003d1714632347\"\u003e will no more than 10\u003csup\u003e5\u003c/sup\u003e."}},{"title":"Output","value":{"format":"HTML","content":"For every case, you should output \"Case #t: \" at first, without quotes. The \u003ci\u003et\u003c/i\u003e is the case number starting from 1.\u003cbr\u003eThen follows the answer. which indicates the number of different ways of placing candies in the nth pile that will make Mzry1992 lose."}},{"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\u003e1\r\n1 2 3\r\n3\r\n3 4\r\n1 8\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}