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

165/463

Solve/Submission

Ranking

# 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 Nazmul0092 Cpp14 0.00s
07 Rijoanul_Shanto Cpp14 0.00s
08 Mahbub_Rahman Cpp14 0.00s
09 Knight_King Cpp14 0.00s
10 maxhasan Cpp14 0.00s
11 lazyfahim Cpp14 0.00s
12 mjtbasif Cpp14 0.00s
13 deder Cpp14 0.00s
14 SbrTa Cpp14 0.00s
15 Logic_Hunter Cpp14 0.00s
16 Monir_AUST Cpp14 0.00s
17 mir_lutfur_rahman Cpp14 0.00s
18 shahad_mahmud Cpp 0.00s
19 afzalul Cpp14 0.00s
20 a_rahman Cpp14 0.00s
21 FariD Cpp 0.00s
22 nafiamahjabin Cpp14 0.00s
23 feodorv C 0.00s
24 AlaminJust Cpp14 0.00s
25 gulzar Cpp14 0.00s
26 seyedssz Cpp14 0.00s
27 adil_reza Cpp14 0.00s
28 jualahmed Cpp14 0.00s
29 Salty_Coder Cpp14 0.00s
30 khmahbub20 Cpp 0.00s
31 sadia2427 Cpp14 0.00s
32 Khayrul_34 Cpp14 0.00s
33 Dragon_162 Cpp14 0.00s
34 sirpoka Cpp14 0.00s
35 Rakib05 Cpp 0.00s
36 tico88612 Cpp14 0.00s
37 Roy_Sporsho Cpp 0.00s
38 HM39 Cpp14 0.00s
39 sb_rithu Cpp14 0.00s
40 tonu Cpp14 0.00s
41 Mahadi024 Cpp14 0.00s
42 lolcoder Cpp 0.00s
43 soumitro_cse1604114 Cpp14 0.00s
44 zobair14 Cpp14 0.00s
45 emoncse Cpp 0.00s
46 Ehsanul_Fahad Cpp 0.00s
47 Morass Cpp14 0.00s
48 joymollick Cpp14 0.00s
49 sazzad33r C 0.00s
50 cosmicray001 Cpp 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support