• Loading...


0-57:0-33
Accepted
3

View Plain Text

  1. main()
  2. {
  3.   int t,n,ans,fo,i;
  4.   scanf("%d",&t);
  5.   while(t--)
  6.   {
  7.      
  8.     scanf("%d%d",&n,&fo);
  9.     ans=fo;
  10.     for(i=0;i<n;i++)
  11.     {
  12.       if(ans>=10000) ans=ans%10000;
  13.       else if(ans<10000&&ans%2==0) ans=ans*2+5;
  14.       else if(ans<10000&&ans%2!=0) ans=ans+3;
  15.     }
  16.      printf("%d\n",ans);
  17.    }
  18.  
  19.  
  20. }
  21.    
  22.  


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