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 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




# User Language Timing
01 rajdipsaha Cpp14 0.00s
02 asiuzzaman006 Cpp14 0.00s
03 ash12 Cpp14 0.00s
04 shabbirdu2012 Cpp14 0.00s
05 MAHRahat Cpp14 0.00s
06 Nazmul_WUB Cpp14 0.00s
07 Rijoanul_Shanto Cpp14 0.00s
08 Mahbub_Rahman Cpp14 0.00s
09 Foysol_Ahmed Cpp 0.00s
10 t0whid Cpp 0.00s
11 Knight_King Cpp14 0.00s
12 maxhasan Cpp14 0.00s
13 lazyfahim Cpp14 0.00s
14 shafayet_hossain Cpp 0.00s
15 mjtbasif Cpp14 0.00s
16 deder Cpp14 0.00s
17 SbrTa Cpp14 0.00s
18 Logic_Hunter Cpp14 0.00s
19 Monir_AUST Cpp14 0.00s
20 mir_lutfur_rahman Cpp14 0.00s
21 shahad_mahmud Cpp 0.00s
22 afzalul Cpp14 0.00s
23 a_rahman Cpp14 0.00s
24 FariD Cpp 0.00s
25 Tanvirh Cpp 0.00s
26 nafiamahjabin Cpp14 0.00s
27 feodorv C 0.00s
28 AlaminJust Cpp14 0.00s
29 neel71 Cpp 0.00s
30 gulzar Cpp14 0.00s
31 seyedssz Cpp14 0.00s
32 adil_reza Cpp14 0.00s
33 jualahmed Cpp14 0.00s
34 sirpoka Cpp14 0.00s
35 Salty_Coder Cpp14 0.00s
36 khmahbub20 Cpp 0.00s
37 sadia2427 Cpp14 0.00s
38 Khayrul_34 Cpp14 0.00s
39 SakibAlamin Cpp14 0.00s
40 Rakib05 Cpp 0.00s
41 tico88612 Cpp14 0.00s
42 Roy_Sporsho Cpp 0.00s
43 kheya Cpp 0.00s
44 HM39 Cpp14 0.00s
45 sb_rithu Cpp14 0.00s
46 tonu Cpp14 0.00s
47 Mahadi024 Cpp14 0.00s
48 lolcoder Cpp 0.00s
49 soumitro_cse1604114 Cpp14 0.00s
50 1604099_ishtiaq Cpp 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support