{"problem":{"name":"Money in Hand","description":{"content":"Takahashi has $N$ kinds of coins; specifically, for $1\\leq i\\leq N$, he has $B_i$ coins worth $A_i$ yen (the currency in Japan) each. Determine if Takahashi can pay exactly $X$ yen (without change) wi","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc286_d"},"statements":[{"statement_type":"Markdown","content":"Takahashi has $N$ kinds of coins; specifically, for $1\\leq i\\leq N$, he has $B_i$ coins worth $A_i$ yen (the currency in Japan) each.\nDetermine if Takahashi can pay exactly $X$ yen (without change) with the coins he currently has.\n\n## Constraints\n\n*   $1\\leq N\\leq 50$\n*   $1\\leq X\\leq 10^4$\n*   $1\\leq A_i\\leq 100$\n*   $1\\leq B_i\\leq 50$\n*   $A_i$ are pairwise distinct.\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $X$\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":"abc286_d","tags":[],"sample_group":[["2 19\n2 3\n5 6","Yes\n\nTakahashi has three $2$\\-yen coins and six $5$\\-yen coins. He can use two $2$\\-yen coins and three $5$\\-yen coins to pay exactly $2\\times 2+5\\times 3=19$ yen. Thus, `Yes` should be printed."],["2 18\n2 3\n5 6","No\n\nThere is no combination of the coins that he can use to pay exactly $18$ yen. Thus, `No` should be printed."],["3 1001\n1 1\n2 1\n100 10","Yes\n\nHe need not use all kinds of coins."]],"created_at":"2026-03-03 11:01:14"}}