Programming contests

ACM ICPC Central European Regional Contest, Prague, 2007, 2011, Practice Session

November 29, 2011 6:45 PM – February 1, 2012 12:00 AM

Character Recognition

The university bought a new program for Optical Character Recognition (OCR). The program is used for transforming paper documentation to an electronic form. Obviously, the transformation process is not 100% reliable and some characters are not recognized. Your task is to write a program that determines the recognition process efficiency ratio. The ratio should be computed as R/A where R is the number of recognized characters and A is the number of all characters. End-of-line characters (newlines) do not count as characters.

Input Specification

The input consists of N test cases. The number of them (N) is given on the first line of the input file. Each test case contains at least one line of processed text where unrecognized characters are represented by "#". There is one empty line after each test case, including the last one. No other lines may be empty. No line will be longer than 100 characters.

Output Specification

Print exactly one line for each test case. The line should contain the sentence "Efficiency ratio is X%.", where X is the ratio in percent, rounded to the nearest number with exactly one digit after the decimal point (0.05 rounds up to 0.1).

Sample Input

  1. 3
  2. Pr#nt ex##tly one##ine for#eac# te#t c#se.
  3. None.
  4. The i#put consists of
  5. N test ca#es. The number
  6. of th#m (N) is given on
  7. the first #ine
  8. of the#input#file.
download as text file

Output for Sample Input

  1. Efficiency ratio is 78.6%.
  2. Efficiency ratio is 100%.
  3. Efficiency ratio is 94%.
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019