```
#include<bits/stdc++.h>
using namespace std;
bool cansum(vector<int>& num,vector<int>& dp,int x)
{
if(x==0)
return true;
if(x<0)
return false;
if(dp[x])
return dp[x];
for(int i=0;i<num.size();i++)
{
if(cansum(num,dp,x-num[i]))
{
dp[x]=1;
return true;
}
}
dp[x]=0;
return false;
}
int main()
{ int x=300;
vector<int> num{7,14};
vector<int> dp(x+1,0);
cout<<cansum(num,dp,x);
return 0;
}
```

why is this TLE?