• Loading...


51:42
Accepted
4

View Plain Text

  1.  
  2. v;
  3. int f(int n)
  4. {if(n==0)
  5.     {return v;}
  6. else
  7. {int k=f(n-1);
  8.    return k>=10000?k%10000:k%2==0?2*k+5:k+3;
  9. }
  10. }
  11. int main()
  12. {int n,c,w;
  13. scanf("%d",&c);
  14. while(c--)
  15. {scanf("%d%d",&n,&w);
  16. v=w;
  17. printf("%d\n",f(n));
  18. }
  19. }
  20.  


List of Keywords used
    None


Trial 1
Trial 2
Trial 3
Trial 4
Submissions
Multipurpose
1000 pt
You are not logged in
0 / 170

Datatype
1000 pt
You are not logged in
0 / 308

No Bitwise
1000 pt
You are not logged in
0 / 78

Cuboid
1000 pt
You are not logged in
0 / 166

Evaluate the function
1000 pt
You are not logged in
0 / 94

Largest in the set
1000 pt
You are not logged in
0 / 69

2 to N
1000 pt
You are not logged in
0 / 144