#P16483. [GKS 2014 #B] New Years Eve

    ID: 16468 Type: RemoteJudge 1000ms 1024MiB Tried: 0 Accepted: 0 Difficulty: 5 Uploaded By: Tags>模拟递推2014Special JudgeGoogle Kick Start

[GKS 2014 #B] New Years Eve

题目描述

At new years party there is a pyramidal arrangement of glasses for wine. For example, at the top level, there would just be one glass, at the second level there would be three, then 66 and then 1010 and so on and so forth like the following image:

:::align{center} :::

The glasses are numbered using 22 numbers, LL and NN. LL represents the level of the glass and NN represents the number in that level. Numbers in a given level are as follows:

Level 1:
 1
Level 2:
  1
 2 3
Level 3:
  1
 2 3
4 5 6
Level 4:
   1
  2 3
 4 5 6
7 8 9 10

Each glass can hold 250250ml of wine. The bartender comes and starts pouring wine in the top glass(The glass numbered L=1L = 1 and N=1N = 1) from bottles each of capacity 750750ml.

As wine is poured in the glasses, once a glass gets full, it overflows equally into the 33 glasses on the next level below it and touching it, without any wine being spilled outside. It doesn't overflow to the glasses on the same level beside it. It also doesn't overflow to the any level below next level (directly).

For example: When the glass of L=2L = 2 and N=2N = 2 overflows, the water will overflow to glasses of

L=3L = 3 and N=2N = 2, 44, 55.

Once that the bartender is done pouring BB bottles, figure out how much quantity in ml of wine is present in the glass on level LL with glass number NN.

输入格式

The first line of the input gives the number of test cases, TT. TT test cases follow. Each test case consists of three integers, BB, LL, NN. BB is the number of bottles the bartender pours and LL is the glass level in the pyramid and NN is the number of the glass in that level.

输出格式

For each test case, output one line containing "Case #x: y", where xx is the test case number (starting from 11) and yy is the quantity of wine in ml in that glass.

We recommend outputting yy to 77 decimal places, but it is not required. yy will be considered correct if it is close enough to the correct number: within an absolute or relative error of 10610^{-6}.

7
1 2 1
1 1 1
2 1 1
20 1 1
1 3 1
2 3 1
10 4 10
Case #1: 166.6666667
Case #2: 250.0000000
Case #3: 250.0000000
Case #4: 250.0000000
Case #5: 0.0000000
Case #6: 55.5555556
Case #7: 157.4074074

提示

Limits

1T1501 \le T \le 150.

Small dataset (Test set 1 - Visible)

1B10001 \le B \le 1000.

1L1001 \le L \le 100.

$1 \le N \le \text{Number of glasses on the corresponding level}$.

Large dataset (Test set 2 - Hidden)

1B500001 \le B \le 50000.

1L4001 \le L \le 400.

$1 \le N \le \text{Number of glasses on the corresponding level}$.