DCP-519: Dealing with factorial factors Back to All Problems

Easy Math > Number Theory


Jimmy is late in his class today. His class teacher, Mr. Adnan is a very strict person. He gives Jimmy a problem to solve. Mr. Adnan does not agree to allow Jimmy in his class until he can solve the problem. The problem has the following steps : i. Mr. Adnan gives him a number **N** and Jimmy has to find the **Nth Prime Number**. ii. Then Jimmy adds 1 with this prime number. iii. At last he should calculate all the **Prime Factors** of the factorial of the new number. For example, let us discuss about the first testcase. Here, N=2. As 2nd prime number is 3, we can add 1 with 3, then 3+1=4. Now, 4! =24. If we prime factorize 24, we can see the form, **24 = 2^3 * 3^1**. So the output is 2 and 3 for this case. Input: ------ Input starts with a number **T**, denoting the total number of testcases (**1 ≤ T ≤ 200**). Each next **T** line contains a number **N** (**1 ≤ N ≤ 200**), which has been already defined in the description. Output: ------- For each testcase, output the expected value(s) wanted in the description with testcase numbers. Follow the **Sample Output** section for better clarification. Sample Input ------------ 3 2 3 5 Sample Output ------------- Caso 1 -> 2 3 Caso 2 -> 2 3 5 Caso 3 -> 2 3 5 7 11


Problem Setter:

Shah Newaj Rabbi Shishir

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

143/446

Solve/Submission

Ranking

# User Language Timing
01 Bruteforcekid Cpp14 0.00s
02 pulak_ict_mbstu Cpp14 0.00s
03 mh755628 Cpp 0.00s
04 astinaam Cpp 0.00s
05 sourav_malo C 0.00s
06 belal_mbstu Cpp14 0.00s
07 Riz1ahmed Cpp 0.00s
08 sajjad_h Cpp 0.00s
09 Ayon_neub Cpp 0.00s
10 feodorv C 0.00s
11 mohibur Cpp 0.00s
12 Chayti_Saha98 Cpp 0.00s
13 ehsan_sshuvo96 Cpp 0.00s
14 shaeekh Cpp14 0.00s
15 pencil Cpp14 0.00s
16 Limon_88 Cpp 0.00s
17 mdrifat Cpp 0.00s
18 Shiam7777777 Cpp14 0.00s
19 Reayz Cpp 0.00s
20 mhiceiuk Cpp 0.00s
21 prateepm Cpp14 0.00s
22 imnirob15 Cpp14 0.01s
23 Nuwaisir Cpp 0.01s
24 Robin008 Cpp 0.01s
25 dysnomia C 0.01s
26 monir_18 Cpp 0.01s
27 prottoy919 Cpp 0.01s
28 abd007 Cpp 0.01s
29 Noshin_1703086 C 0.01s
30 TarikulCSE Cpp14 0.01s
31 tariqiitju Cpp14 0.01s
32 Arnob114348 C 0.01s
33 Indrjit_BU Cpp 0.01s
34 ssavi Cpp 0.01s
35 tahsin_protik C 0.01s
36 Methun Cpp 0.01s
37 acwatlerte Cpp 0.01s
38 monir769 Cpp14 0.01s
39 milon019 Cpp 0.01s
40 Ataur Cpp 0.01s
41 fuad036 Cpp 0.01s
42 the_badcoder Cpp 0.01s
43 AlaminJust Cpp 0.01s
44 kabbya Cpp 0.01s
45 asif04 Cpp14 0.01s
46 DynamicOvi Cpp 0.01s
47 bu_hridoy Cpp 0.01s
48 Jisancse Cpp14 0.01s
49 Riad_IIT7 Cpp 0.01s
50 KM_Muntasir Cpp14 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support