DCP-5: Solve the Recursion Back to All Problems

Easy Beginners Problems > Ad-hoc

Today one of the developers of Dev Skill team found a bug. His code has been crashing after some test run. He analyzed the issue for a while. After sometime he found the problem. This issue has occurred for a simple recursion method which is given below: ![recursion][1] The problem with the recursion is when large values are given as input in that recursion function the program crashes. The developer with his experience understands that this recursion can be simplified to avoid this issue. But the developer has another assigned task. He needs someone else to simplify the recursion. He made some sample input-output for that person that caused the current recursion to fail so that after he simplifies the recursion he/she can use the test data to check whether it is working now or not. Input: ------ Each test case contains three integers n1, n2 and n3 **(1 ≤ n1, n2, n3 ≤ 10^9)** in a single line separated by a space. Output: ------- Print the result of the **recur** function for each test case in a line. Sample Input ------------ 6335 18468 42 15725 19170 26501 26963 29359 11479 Sample Output ------------- 12712 54065 65405 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/ea5fa96e-6883-cc93-60d8-08d2e151f404_1f45b3ab7bbd44fdbe526744c6574f33_W443xH255.png

Problem Setter:

MD. Jalal Uddin

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 2.00
C# 2.00
PHP 2.00

Problem Stats




# User Language Timing
01 Monir_AUST Cpp 0.00s
02 Salty_Coder Cpp 0.00s
03 Knight_King Cpp 0.00s
04 seyedssz Cpp 0.00s
05 AlaminJust Cpp 0.00s
06 mahrahat Cpp 0.00s
07 Mahbub_Rahman Cpp 0.00s
08 Khayrul_34 Cpp 0.00s
09 ash12 Cpp 0.00s
10 sadia2427 Cpp 0.00s
11 mir_lutfur_rahman Cpp 0.00s
12 Logic_Hunter Cpp 0.00s
13 adil_reza Cpp 0.00s
14 deder Cpp 0.00s
15 shabbirdu2012 Cpp 0.00s
16 Hasan_Masud Cpp 0.00s
17 rajdipsaha Cpp 0.00s
18 acroaticus Cpp 0.01s
19 SakibAlamin Cpp 0.01s
20 onucsecu Cpp 0.01s
21 nazmul_bzs Cpp 0.01s
22 golapraj Cpp 0.01s
23 ishrafislam2727 Cpp 0.01s
24 emrul Cpp 0.01s
25 Ansarul_14 Cpp 0.01s
26 anik_JU Cpp 0.01s
27 noshin_ju Cpp 0.01s
28 Protap_Ghose Cpp 0.01s
29 Anubis Cpp 0.07s
30 ddevilred1 Cpp 0.07s
31 tuhin_47 Cpp 0.07s
32 SkSaber Cpp 0.07s
33 Faridur Cpp 0.07s
34 Dinar Cpp 0.08s
35 Shadab Cpp 0.08s
36 Partha11 Cpp 0.08s
37 anis Cpp 0.18s
38 Machine Cpp 0.21s
39 Atik_Ahamed Cpp 0.23s
40 ih_hira Cpp 0.26s
41 Mir00r Cpp 0.28s
42 asif3058 Cpp 0.28s
43 rayhan50001 Cpp 0.32s
44 dmehrab06 Cpp 0.33s
45 Saimum_140128 Cpp 0.39s
46 SKL12 Cpp 0.39s
47 ThunderStroke Cpp 0.39s
48 swapnil Cpp 0.40s
49 sazal_dev Cpp 0.40s
50 Ishrak Cpp 0.40s

Your feedback is our precious!

Or call +88 02 9853138 for support