DCP-365: Decrypt The Secret Message Back to All Problems

Easy Beginners Problems > Ad-hoc

Once upon a time there was a famous person named Saadat Chowdhury. He is so much intelligent. One day he invented an algorithm which become popular within few days. His algorithm works on encryption decryption mechanism. For Example, "**LLEELLEELLEELFFTTFTTFHFHIHIM**" **2** **4 3** This secret message without double quotation if passed into his algorithm than it generates the original message of exactly two words of length 4 and length 3. And original message is **LEFT HIM**. (The original message always contains distinct characters) Which means that **largest character occurrences** will be the first character than the second largest one will be the second one and so on. And first **four characters** will makes a word and then **a space** than the last **three characters** makes second word. **If two or more different characters number of occurrence become same than print the characters in alphabetically ascending order**. One day Saadat give few encrypted message to his student and asked him what will be the original message. Now your task is to help the student to decrypt the secret message. ***Note: It is assured that each encrypted message has exactly one valid solution.*** Input: ------ The first line will contain the test case **T(T<=10)** and the next line will contain an encrypted message **S**. The message will contain uppercase english letters and the length of the secret message does not exceed **400 characters**. And the next line contain a number **N(1<=N<=10)** which is the total number of words in the **original message**. And the next line will contain **ith** word length **Li**. For more specifications see the sample input. Output: ------- The output will be start by the case number like "**Case x:** " without double quotation where **x** denotes the case number. And after that the original message of the encrypted message according to the method mentioned in problem description. For more specifications see the sample output. Sample Input ------------ 2 LLEELLEELLEELFFTTFTTFHFHIHIM 2 4 3 HHHHHHHIIIII 1 2 Sample Output ------------- Case 1: LEFT HIM Case 2: HI

Problem Setter:

Mir Lutfur Rahman

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats




# User Language Timing
01 showmic Cpp 0.00s
02 njrafi Cpp 0.00s
03 mahbub07 Cpp 0.00s
04 akram Cpp 0.00s
05 Sarwar05 Cpp 0.00s
06 nurshuvo51 Cpp 0.00s
07 kissu_pari_na Cpp 0.00s
08 cse_nazmul Cpp 0.00s
09 subhashis_cse Cpp 0.00s
10 Reayz Cpp 0.00s
11 mhiceiuk Cpp 0.00s
12 ssavi Cpp 0.00s
13 haasib Cpp 0.00s
14 jayed_al_hasan Cpp 0.00s
15 ____ Cpp 0.00s
16 shamimjucse Cpp 0.00s
17 yasirnabil534 Cpp 0.00s
18 yakin Cpp 0.00s
19 Trusted_Frustrated Cpp14 0.00s
20 SakibAlamin Cpp14 0.00s
21 Aman_khan Cpp 0.00s
22 afzalul C 0.00s
23 rayhan50001 Cpp14 0.00s
24 feodorv C 0.00s
25 Pure_Protea Cpp 0.00s
26 FahimSifnatul Cpp 0.00s
27 Morass Cpp14 0.00s
28 rummanrakib11 Cpp14 0.00s
29 sazal_dev Cpp 0.00s
30 tariqiitju Cpp 0.00s
31 souravahmed C 0.00s
32 SkSaber Cpp14 0.01s
33 a_rahman Cpp 0.01s
34 deder Cpp 0.01s
35 anik_JU Cpp 0.01s
36 Logic_Hunter Cpp14 0.01s
37 indroneel Cpp 0.01s
38 aseem_cu Cpp14 0.01s
39 nasib_mbstu Cpp14 0.01s
40 emrul Cpp14 0.01s
41 RandyWaterhouse Python3 0.03s

Your feedback is our precious!

Or call +88 02 9853138 for support