Programming contests

Magas szintű programozási nyelvek 1, egyéni verseny, 2012. április 22.

April 22, 2012 10:15 AM – April 22, 2012 3:15 PM

Slow Motion

“Slow motion” is a technique in filmmaking whereby time appears to be slowed down. Typically this is achieved when each film frame is captured at a rate much faster than it will be played back. When replayed at normal speed, time appears to be moving slower.

It is possible to apply slow motion also for texts: by duplicating every letter, you can halve the reading speed. Your task is to write a program that “slows down” a given text.

Input Specification

The input contains several blocks of test cases. The first line of each case contains a single integer 1 ≤ n ≤ 1000, the number of lines of the input text. The next n lines contain the input text, which consists of only lowercase letters and spaces. The length of each line is at most 1000.

The input is terminated by a block with n = 0.

Output Specification

For each test case, you have to output the “slowed-down” version of the text: each character (including the spaces but not the new line characters) should be output two times.

Sample Input

  1. 2
  2.  one  two
  3. three
  4. 0
download as text file

Output for Sample Input

  1.   oonnee    ttwwoo
  2. tthhrreeee
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019