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 HM39 Cpp 0.00s
17 rajdipsaha Cpp 0.00s
18 asiuzzaman006 Cpp 0.00s
19 Dragon_162 Cpp 0.00s
20 nafiamahjabin Cpp 0.00s
21 mjtbasif Cpp 0.00s
22 gulzar Cpp 0.00s
23 a_rahman Cpp 0.00s
24 jualahmed Cpp 0.00s
25 maxhasan Cpp 0.00s
26 lazyfahim Cpp 0.00s
27 Rijoanul_Shanto Cpp 0.00s
28 tonu Cpp 0.00s
29 Nazmul0092 Cpp 0.00s
30 anik_ewu Cpp 0.01s
31 Linkon_Ruhul Cpp 0.01s
32 bug_hunter Cpp 0.01s
33 gazi93 Cpp 0.01s
34 ammasum Cpp 0.01s
35 lightlessShadO Cpp 0.01s
36 subhashis_cse Cpp 0.01s
37 acroaticus Cpp 0.01s
38 onucsecu Cpp 0.01s
39 nazmul_bzs Cpp 0.01s
40 golapraj Cpp 0.01s
41 ishrafislam2727 Cpp 0.01s
42 emrul Cpp 0.01s
43 Ansarul_14 Cpp 0.01s
44 anik_JU Cpp 0.01s
45 noshin_ju Cpp 0.01s
46 Protap_Ghose Cpp 0.01s
47 mhmbd CSharp 0.03s
48 Anubis Cpp 0.07s
49 ddevilred1 Cpp 0.07s
50 tuhin_47 Cpp 0.07s

Your feedback is our precious!

Or call +88 02 9853138 for support