{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"Piotr found a magical box in heaven. Its magic power is that if you place any red balloon inside it then, after one hour, it will multiply to form 3 red and 1 blue colored balloons. Then in the next hour,each of the red balloons will multiply in the same fashion, but the blue one will multiply to form 4 blue balloons. This trend will continue indefinitely.\n\nThe arrangements of the balloons after the 0-th, 1-st, 2-nd and 3-rd hour are depicted in the following diagram.\n\nAs you can see, a red balloon in the cell (i; j) (that is i-th row and j-th colum n) will multiply to produce 3 red balloons in the cells (i*2-1; j*2-1), (i*2-1; j*2), (i*2; j*2-1) and a blue balloon in the cell (i*2; j*2). Whereas, a blue balloon in the cell (i; j) will multiply to produce 4 blueballoons in the cells (i*2-1; j*2-1), (i*2-1; j*2), (i*2; j*2-1) and (i*2; j*2). The grid size doubles (in both the direction) after every hour in order to accommodate the extra balloons.In this problem, Piotr is only interested in the count of the red balloons; more specifically, he would like to know the total number of red balloons in all the rows from A to B after K-th hour.\nInput\nThe first line of input is an integerT(T \u003c1000) that indicates the number of test cases. Each case contains 3 integers K,A and B. The meanings of these variables are mentioned above.K will be inthe range [0;30] and 1\u003c\u003dA,B\u003c\u003d2^K.\n\nOutput\n\nFor each case, output the case number followed by the total number of red balloons in rows [A; B] after K-th hour.\n\nSample Input\n\n3\n0 1 1\n3 1 8\n3 3 7\n\nSample Output\n\nCase 1: 1\nCase 2: 27\nCase 3: 14\n\n"}},{"title":"","value":{"format":"PLAIN","content":"Piotr在天堂发现了一个神奇的盒子。它的魔力是,如果你把任何一个红色的气球放在里面,一个小时后,它就会繁殖成3个红色和1个蓝色的气球,然后在下一个小时里,每个红色的气球都会以同样的方式繁殖,但蓝色的气球会繁殖成4个蓝色的气球。然后在下一个小时内,每个红色的气球都会以同样的方式繁殖,但蓝色的气球会繁殖成4个蓝色的气球。这种趋势将无限期地持续下去。\n\n下图是0-3、1-st、2-nd、3-小时后气球的排列情况。\n\n正如你所看到的,在单元格(i;j)中的一个红色气球(即第i行和第j列)将在单元格(i*2-1;j*2-1)、(i*2-1;j*2)、(i*2;j*2-1)中繁殖产生3个红色气球,在单元格(i*2;j*2)中产生一个蓝色气球。而单元格(i;j)中的一个蓝色气球将在单元格(i*2-1;j*2-1)、(i*2-1;j*2)、(i*2;j*2-1)和(i*2;j*2)中繁殖产生4个蓝色气球。在这个问题中,Piotr只对红色气球的数量感兴趣;更具体地说,他想知道K-th小时后从A到B的所有行中红色气球的总数。\n輸入\n输入的第一行是一个整数T(T\u003c1000),表示测试用例的数量。每个案例包含3个整数K,A和B,这些变量的含义如上所述。\n\n輸出結果\n\n对于每个案例,在K-th小时后,输出案例编号和行[A; B]中红色气球的总数。\n\n输入示例\n\n3\n0 1 1\n3 1 8\n3 3 7\n\n采样输出\n\n案例1:1\n案件2:27\n案件3:14\n\n"}}]}