Professional Documents
Culture Documents
h>
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define mod 1000000007
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define fast_io std::ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
typedef long long int ll;
using namespace std;
ll mx = 100000000000000;
ll t[3000],c[3000];
ll dp[3000][3000];
if(dp[n][weight]!=-1)
return dp[n][weight];
// cout<<n<<" "<<weight<<endl;
if(weight<=0)
return 0;
if(n==0)
return mx;
ll x = f(n-1,weight);
int main()
{
int n;
cin>>n;
for (int i = 0; i < n; ++i)
{
cin>>t[i]>>c[i];
t[i]++;
}
loop(i,0,3000)loop(j,0,3000)dp[i][j]=-1;
ll ans = f(n,n);
cout<<ans<<endl;
return 0;
}