DCP-327: Critical Encryption Back to All Problems

Hard Math > Number Theory

A certain **mathematician** and **cryptanalyst** after breaking enigma during 2nd world war gave a new encryption mechanism. At that time it was considered unbreakable. Recently, someone was able to break the code. The challenge is whether you can break it on your own or not. Suppose, you are transmitting a list of prime numbers only, you multiply every prime number in the list with a constant greater than 1 which is known only to you and your receiver. Then transmit the modified list. Your receiver can then decrypt the transmission. On the other hand, any interceptor of the transmission will be lost in the ocean on encrypted message without a clue or at least that was expected. <br> Now you will be given a list of encrypted numbers, you are to decrypt them. Sometimes the transmitted message may become corrupted that is decrypted numbers might not be prime numbers , these are **invalid messages**. Also, If there exists only one number in the list, then you **can not decrypt** it. Input: ------ The first line of input contains an integer **T (1<=T<=10)** denoting the number of test cases. Next T cases each begins with an integer **N (1<=N<=10000)** representing the number of element in the list. Next, there will be **N** non-negative integers which are the transmitted encrypted numbers (each number will be in the range of **0** to **10^16**). Output: ------- For each case print the case number and then if the given message cannot be decrypted then print **"Can't decrypt"** without the quote. Otherwise, if the decrypted message is a valid message according to the statement then print the decrypted message. Otherwise print **"Invalid message"** without the quote. Sample Input ------------ 4 2 4 10 3 0 4 5 2 55 505 1 26 Sample Output ------------- Case 1: 2 5 Case 2: Invalid message Case 3: 11 101 Case 4: Can't decrypt

Problem Setter:

Mohammad Abdullah Matin Khan Zarzis

Please login to submit solution to this problem.

Problem Limits

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

Problem Stats




# User Language Timing
01 Bruteforcekid Cpp 0.07s
02 Morass Cpp14 0.12s
03 feodorv C 0.26s
04 adamantium Cpp 0.35s
05 RezwanArefin01 Cpp14 0.38s
06 Robbinb1993 Cpp 0.67s
07 ssavi Cpp14 0.76s
08 Brokenlog Cpp14 0.77s
09 pulak_ict_mbstu Cpp 0.78s
10 Tahmid Cpp 0.79s
11 fsshakkhor Cpp14 1.09s
12 Nirjhor Cpp14 1.49s
13 tariqiitju Cpp 1.65s
14 bishal_biswas Cpp14 1.75s
15 ____ Cpp 2.27s
16 I_See_You Cpp14 3.78s

Your feedback is our precious!

Or call +88 02 9853138 for support