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

Your feedback is our precious!

Or call +88 02 9853138 for support