Doubt in one question

Here i am solving this question from gfg…
Name-Recursive Sequence…
Question link–> https://practice.geeksforgeeks.org/problems/recursive-sequence/0

This is my solution…
I have used long long int then also it is showing wrong output for n>=7 it is showing right output till 1 to 6.
Please check this…

This is my solution… https://ide.codingblocks.com/s/330300

hello @ashishnnnnn

there r t test cases , so u need to call ur solve function t times .
also make ur function return type as long long

check ur updated code here ->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.