{"problem":{"name":"Summer Vacation","description":{"content":"There are $N$ one-off jobs available. If you take the $i$\\-th job and complete it, you will earn the reward of $B_i$ after $A_i$ days from the day you do it. You can take and complete at most one of t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc137_d"},"statements":[{"statement_type":"Markdown","content":"There are $N$ one-off jobs available. If you take the $i$\\-th job and complete it, you will earn the reward of $B_i$ after $A_i$ days from the day you do it.\nYou can take and complete at most one of these jobs in a day.\nHowever, you cannot retake a job that you have already done.\nFind the maximum total reward that you can earn no later than $M$ days from today.\nYou can already start working today.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq M \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^5$\n*   $1 \\leq B_i \\leq 10^4$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $B_1$\n$A_2$ $B_2$\n$\\vdots$\n$A_N$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc137_d","tags":[],"sample_group":[["3 4\n4 3\n4 1\n2 2","5\n\nYou can earn the total reward of $5$ by taking the jobs as follows:\n\n*   Take and complete the first job today. You will earn the reward of $3$ after four days from today.\n*   Take and complete the third job tomorrow. You will earn the reward of $2$ after two days from tomorrow, that is, after three days from today."],["5 3\n1 2\n1 3\n1 4\n2 1\n2 3","10"],["1 1\n2 1","0"]],"created_at":"2026-03-03 11:01:13"}}