시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 0 0 0 0.000%

문제

Imagine some Soccer World Cup. After the first stage, 16 countries are remaining now, among which the winner is determined by the following tournament (the names are from the sample input but could also be different):

 1 Germany ----+
               +-- ? --+
 2 Sweden -----+       |
                       +-- ? --+
 3 Argentina --+       |       |
               +-- ? --+       |
 4 Mexico -----+               |
                               +-- ? --+
 5 Italy ------+               |       |
               +-- ? --+       |       |
 6 Australia --+       |       |       |
                       +-- ? --+       |
 7 Switzerl ---+       |               |
               +-- ? --+               |
 8 Ukraine ----+                       |
                                       +-- World Champion
 9 England ----+                       |
               +-- ? --+               |
10 Ecuador ----+       |               |
                       +-- ? --+       |
11 Portugal ---+       |       |       |
               +-- ? --+       |       |
12 Holland ----+               |       |
                               +-- ? --+
13 Brazil -----+               |
               +-- ? --+       |
14 Ghana ------+       |       |
                       +-- ? --+
15 Spain ------+       |
               +-- ? --+
16 France -----+

For each possible match A vs. B between these 16 nations, you are iven the probability that team A wins against B. Your task is to determine for each nation the chance to become the world champion.

입력

The first line contains the number of scenarios. For each scenario, the first 16 lines tell the names of the 16 countries (each a single string of up to 10 letters), from top to bottom according to the structure given above. Next, a 16 × 16 integer matrix p is specified, where element pi,j gives the probability in percent that the ith country defeats the jth country in a direct match, e. g. the p1,13 = 57 in the sample input means that in a match between Germany and Brazil, Germany wins with a probability of 57%. Note that matches may not end in a draw, i. e. pi,j + pj,i = 100 for all i, j.

출력

The output for every scenario begins with a line containing “Scenario #i:”, where i is the number of the scenario starting at 1. Then print 16 lines of width 17, on the left the country’s name, on the right its chance in percent to become world champion, rounded to two decimal places. Print space characters to fill the middle. Use the same order of countries as given in the input file. Terminate each scenario with a blank line.

예제 입력

1
Germany
Sweden
Argentina
Mexico
Italy
Australia
Switzerl
Ukraine
England
Ecuador
Portugal
Holland
Brazil
Ghana
Spain
France
 50  67  55  70  65  77  75  72  62  75  65  63  57  80  56  68
 33  50  38  53  48  60  58  55  45  58  48  46  40  63  39  51
 45  62  50  65  60  72  70  67  57  70  60  58  52  75  51  63
 30  47  35  50  45  57  55  52  42  55  45  43  37  60  36  48
 35  52  40  55  50  62  60  57  47  60  50  48  42  65  41  53
 23  40  28  43  38  50  48  45  35  48  38  36  30  53  29  41
 25  42  30  45  40  52  50  47  37  50  40  38  32  55  31  43
 28  45  33  48  43  55  53  50  40  53  43  41  35  58  34  46
 38  55  43  58  53  65  63  60  50  63  53  51  45  68  44  56
 25  42  30  45  40  52  50  47  37  50  40  38  32  55  31  43
 35  52  40  55  50  62  60  57  47  60  50  48  42  65  41  53
 37  54  42  57  52  64  62  59  49  62  52  50  44  67  43  55
 43  60  48  63  58  70  68  65  55  68  58  56  50  73  49  61
 20  37  25  40  35  47  45  42  32  45  35  33  27  50  26  38
 44  61  49  64  59  71  69  66  56  69  59  57  51  74  50  62
 32  49  37  52  47  59  57  54  44  57  47  45  39  62  38  50

예제 출력

Scenario #1:
Germany     17.69
Sweden       3.45
Argentina   12.32
Mexico       2.65
Italy        7.04
Australia    1.81
Switzerl     2.43
Ukraine      3.46
England      7.75
Ecuador      1.83
Portugal     5.19
Holland      6.36
Brazil      12.20
Ghana        0.89
Spain       11.47
France       3.46

힌트