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

154/421

Solve/Submission

Ranking

# User Language Timing
01 Monir_AUST Cpp14 0.00s
02 Salty_Coder Cpp14 0.00s
03 Knight_King Cpp14 0.00s
04 seyedssz Cpp14 0.00s
05 AlaminJust Cpp14 0.00s
06 MAHRahat Cpp14 0.00s
07 Mahbub_Rahman Cpp14 0.00s
08 adil_reza Cpp14 0.00s
09 Khayrul_34 Cpp14 0.00s
10 ash12 Cpp14 0.00s
11 sadia2427 Cpp14 0.00s
12 mir_lutfur_rahman Cpp14 0.00s
13 Logic_Hunter Cpp14 0.00s
14 shabbirdu2012 Cpp14 0.00s
15 HM39 Cpp14 0.00s
16 deder Cpp14 0.00s
17 rajdipsaha Cpp14 0.00s
18 asiuzzaman006 Cpp14 0.00s
19 Dragon_162 Cpp14 0.00s
20 nafiamahjabin Cpp14 0.00s
21 mjtbasif Cpp14 0.00s
22 gulzar Cpp14 0.00s
23 a_rahman Cpp14 0.00s
24 maxhasan Cpp14 0.00s
25 lazyfahim Cpp14 0.00s
26 Rijoanul_Shanto Cpp14 0.00s
27 tonu Cpp14 0.00s
28 jualahmed Cpp14 0.00s
29 Nazmul0092 Cpp14 0.00s
30 SbrTa Cpp14 0.00s
31 soumitro_cse1604114 Cpp14 0.00s
32 sb_rithu Cpp14 0.00s
33 afzalul Cpp14 0.00s
34 zobair14 Cpp14 0.00s
35 joymollick Cpp14 0.00s
36 lolcoder Cpp 0.00s
37 tico88612 Cpp14 0.00s
38 Mahadi024 Cpp14 0.00s
39 khmahbub20 Cpp 0.00s
40 FariD Cpp 0.00s
41 emoncse Cpp 0.00s
42 Roy_Sporsho Cpp 0.00s
43 feodorv C 0.00s
44 Morass Cpp14 0.00s
45 ashraf_neo Cpp 0.01s
46 pulak_ict_mbstu Cpp14 0.01s
47 DynamicOvi Cpp14 0.01s
48 mrinmoi Cpp 0.01s
49 msabir Cpp14 0.01s
50 rithu Cpp14 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support