Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Language: Mixed Numbers
Description A mixed fraction is defined recursively as follows:
One can draw a view of a mixed fraction using ASCII characters as described below:
We want you to write a program to calculate the value of a mixed fraction from its figure. Input Some 90 degree clockwise rotated figures of a number of mixed fractions are given in the input file. In the first line of each rotated mixed fraction n < 300 and m < 15000 , the length and the width of the figure, are written. In the next m lines the figure i s described ('-' is replaced with '|'). Note that each line will consists of exactly n characters so any number of spaces may be used in the shape, but anyway, the shape of the figure satisfies description explained above.
The input ends with a line containing two zeroes. Output For each test case write its value in a separate line. Your answer must be rounded to two digits after decimal point and the output must contain exactly two digits after the decimal point. Sample Input 8 6 1 2 | 2 4|2| 4|3 | + 1 0 0 Sample Output 3.10 Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator