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: Arne Saknussemm
Description Following the account of Jules Verne, a scrambled message written by the middle age alchemist Arne Saknussemm, and deciphered by professor Lidenbrock, started the incredible travel to the center of the Earth. The scrambling procedure used by Arne is alike the procedure given below. 1. Take a non empty message M that contains letters from the English alphabet, digits, commas, dots, quotes (i.e.
0<K≤length(M) and add trailing spaces to M such that the length of the resulting message, say M', is the least multiple of K. For K=19 and the message above, where length(M)=74 (including the 8 spaces and the line break that M contains), two trailing spaces are added yielding the message M' with length(M')=76.3. Replace all the spaces from
4. Write the message that results from step 3 in a table with
5. The strings of characters that correspond to the rows of the table are the
Write a program that deciphers non empty messages scrambled as described. The length of a message, before scrambling, is at most Input The program input is from a text file where each data set corresponds to a scrambled message. A data set starts with an integer Output The deciphered message must be printed on the standard output, from the beginning of a line and must be followed by an empty line as shown in the input/output sample below. Sample Input 4 _etmneet_t\udsmt_fS _gtuerr_,asaneeasf_ .narctrtria_edrrlen si_t_seeovdec_ecenI 11 e n r e V _ s e l u J Sample Output In Sneffels craterem descende audas viator, et terrestre centrum attinges. Jules Verne Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator