{"problem":{"name":"Megalomania","description":{"content":"Kizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs. Let the current time be time $0$. Kizahashi ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc131_d"},"statements":[{"statement_type":"Markdown","content":"Kizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.\nLet the current time be time $0$. Kizahashi has $N$ jobs numbered $1$ to $N$.\nIt takes $A_i$ units of time for Kizahashi to complete Job $i$. The deadline for Job $i$ is time $B_i$, and he must complete the job before or at this time.\nKizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.\nCan Kizahashi complete all the jobs in time? If he can, print `Yes`; if he cannot, print `No`.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq A_i, B_i \\leq 10^9 (1 \\leq i \\leq N)$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $B_1$\n$.$\n$.$\n$.$\n$A_N$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc131_d","tags":[],"sample_group":[["5\n2 4\n1 9\n1 8\n4 9\n3 12","Yes\n\nHe can complete all the jobs in time by, for example, doing them in the following order:\n\n*   Do Job $2$ from time $0$ to $1$.\n*   Do Job $1$ from time $1$ to $3$.\n*   Do Job $4$ from time $3$ to $7$.\n*   Do Job $3$ from time $7$ to $8$.\n*   Do Job $5$ from time $8$ to $11$.\n\nNote that it is fine to complete Job $3$ exactly at the deadline, time $8$."],["3\n334 1000\n334 1000\n334 1000","No\n\nHe cannot complete all the jobs in time, no matter what order he does them in."],["30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334 5720","Yes"]],"created_at":"2026-03-03 11:01:13"}}