I have been trying the Bytelandian gold coins problem but my code runs with “Time limit exceeded” result. I am a little less intimate with recursion. Can anyone help me out.

My code is as follows:

```
#define MAX(a,b) a>b?a:b
unsigned long int max=0;
int findMax(unsigned long int n)
{
if(n<12)
return n;
else
{
max=findMax(n/2)+findMax(n/3)+findMax(n/4);
return MAX(max,n);
}
}
int main()
{
unsigned long int n;
while(scanf("%lu",&n)!=EOF)
{
printf("%lu\n",findMax(n));
}
return 0;
}
```