https://www.codechef.com/problems/COINS

https://www.codechef.com/problems/COINS

Can anybody please explain where my code goes wrong?

using namespace std;
#include<bits/stdc++.h>
int main()
{
long long n;
cin>>n;
long long arr[n+1];
for(long long i=0;i<=n;i++)
{
if(i<12)
{
arr[i]=i;
}
else
{
arr[i]=max(i,arr[(i)/2]+arr[(i)/3]+arr[(i)/4]);
}
}
cout<<arr[n]<<endl;
return 0;
}