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 adil_reza Cpp 0.00s
09 golapraj Cpp 0.01s
10 ishrafislam2727 Cpp 0.01s
11 emrul Cpp 0.01s
12 Ansarul_14 Cpp 0.01s
13 anik_JU Cpp 0.01s
14 noshin_ju Cpp 0.01s
15 Protap_Ghose Cpp 0.01s
16 Anubis Cpp 0.07s
17 ddevilred1 Cpp 0.07s
18 tuhin_47 Cpp 0.07s
19 SkSaber Cpp 0.07s
20 Faridur Cpp 0.07s
21 Dinar Cpp 0.08s
22 Shadab Cpp 0.08s
23 Partha11 Cpp 0.08s
24 anis Cpp 0.18s
25 Machine Cpp 0.21s
26 Atik_Ahamed Cpp 0.23s
27 ih_hira Cpp 0.26s
28 Mir00r Cpp 0.28s
29 asif3058 Cpp 0.28s
30 rayhan50001 Cpp 0.32s
31 dmehrab06 Cpp 0.33s
32 Saimum_140128 Cpp 0.39s
33 SKL12 Cpp 0.39s
34 ThunderStroke Cpp 0.39s
35 swapnil Cpp 0.40s
36 sazal_dev Cpp 0.40s
37 Ishrak Cpp 0.40s
38 haasib Cpp 0.40s
39 tariqiitju Cpp 0.41s
40 moshiur_cse15 Cpp 0.41s
41 Masum_ice Cpp 0.42s
42 Unseen Cpp 0.42s
43 Alim14 Cpp 0.42s
44 prodip_bsmrstu Cpp 0.42s
45 clcrr Cpp 0.42s
46 froghramar Cpp 0.42s
47 Jubayer_Hasan Cpp 0.42s
48 ssavi Cpp 0.46s
49 mhiceiuk Cpp 0.49s
50 showmic Cpp 0.50s

Your feedback is our precious!

Or call +88 02 9853138 for support