{"problem":{"name":"Online Shopping","description":{"content":"AtCoder Inc. sells merchandise through its [online shop](https://suzuri.jp/AtCoder/home). Takahashi has decided to purchase $N$ types of products from there.   For each integer $i$ from $1$ to $N$, th","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc332_a"},"statements":[{"statement_type":"Markdown","content":"AtCoder Inc. sells merchandise through its [online shop](https://suzuri.jp/AtCoder/home).\nTakahashi has decided to purchase $N$ types of products from there.  \nFor each integer $i$ from $1$ to $N$, the $i$\\-th type of product has a price of $P_i$ yen each, and he will buy $Q_i$ of this.\nAdditionally, he must pay a shipping fee.  \nThe shipping fee is $0$ yen if the total price of the products purchased is $S$ yen or above, and $K$ yen otherwise.\nHe will pay the total price of the products purchased plus the shipping fee.  \nCalculate the amount he will pay.\n\n## Constraints\n\n*   $1\\leq N\\leq 100$\n*   $1\\leq S\\leq 10000$\n*   $1\\leq K\\leq 10000$\n*   $1\\leq P_i\\leq 10000$\n*   $1\\leq Q_i\\leq 100$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $S$ $K$\n$P_1$ $Q_1$\n$P_2$ $Q_2$\n$\\vdots$\n$P_N$ $Q_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc332_a","tags":[],"sample_group":[["2 2000 500\n1000 1\n100 6","2100\n\nTakahashi buys one product for $1000$ yen and six products for $100$ yen each.  \nThus, the total price of the products is $1000\\times 1+100\\times 6=1600$ yen.  \nSince the total amount for the products is less than $2000$ yen, the shipping fee will be $500$ yen.  \nTherefore, the amount Takahashi will pay is $1600+500=2100$ yen."],["3 2000 500\n1000 1\n100 6\n5000 1","6600\n\nThe total price of the products is $1000\\times 1+100\\times 6+5000\\times 1=6600$ yen.  \nSince the total amount for the products is not less than $2000$ yen, the shipping fee will be $0$ yen.  \nTherefore, the amount Takahashi will pay is $6600+0=6600$ yen."],["2 2000 500\n1000 1\n1000 1","2000\n\nThere may be multiple products with the same price per item."]],"created_at":"2026-03-03 11:01:13"}}