Help me in solving COINS problem

My issue

Sir/mam i think my code is correct as i had seen others submissions too. but it is showing TLE in my case.
please tell how can i optimize my code without using any other method

My code

#include <iostream>
using namespace std;

long solve(long n)
    return solve(n/2) + solve(n/3)+ solve( n/4);
    return n;
int main() {
     long n; 
	return 0;

Problem Link: COINS Problem - CodeChef

u have to do memoization u remove tle.
btw your recursive solution is correct.