/
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 233 点
問題文
高橋君はフリーランスのプログラマーとして働いています。現在、 N 件の案件を抱えており、それぞれの案件には番号 1 から N が付けられています。
案件 i は納品まで D_i 日かかる予定で、納品が完了すると V_i 円の報酬を受け取ることができます。
高橋君はエージェント会社を通じて案件を獲得しています。エージェント会社との契約により、受け取った報酬の合計に対して、手数料として P パーセントをエージェント会社に支払わなければなりません。
高橋君は今後 M 日間の収支を計算しようとしています。 M 日以内に納品が完了する案件の報酬の合計から、エージェント会社への手数料を差し引いた金額を求めてください。
ただし、答えは小数点以下を切り捨てた整数で出力してください。
制約
- 1 \leq N \leq 2 \times 10^5
- 1 \leq M \leq 10^9
- 0 \leq P \leq 100
- 1 \leq D_i \leq 10^9
- 1 \leq V_i \leq 10^6
- 入力はすべて整数
入力
N M P D_1 V_1 D_2 V_2 : D_N V_N
- 1 行目には、案件の件数を表す N 、計画期間の日数を表す M 、手数料の割合(パーセント)を表す P が、スペース区切りで与えられる。
- 2 行目から N + 1 行目では、各案件の情報が N 行で与えられる。
- 1 + i 行目では、案件 i の納品までの日数 D_i と、報酬 V_i が、スペース区切りで与えられる。
出力
M 日以内に納品が完了する案件の報酬の合計から、手数料を差し引いた金額を、小数点以下を切り捨てた整数として 1 行で出力してください。
入力例 1
4 5 10 3 1000 5 2000 6 3000 1 500
出力例 1
3150
入力例 2
3 2 20 3 100 5 200 10 300
出力例 2
0
入力例 3
10 30 15 10 12000 30 25000 31 40000 5 8000 25 15000 60 50000 1 3000 29 22000 45 18000 30 7000
出力例 3
78200
入力例 4
30 500 37 120 450000 800 320000 499 100000 500 999999 501 250000 30 75000 365 640000 1000 120000 250 333333 490 222222 10 1000000 700 111111 450 555555 600 444444 1 123456 499 654321 502 98765 300 777777 200 888888 550 99999 400 135790 480 246800 90 112233 510 445566 20 778899 470 314159 900 271828 350 161803 500 424242 750 202020
出力例 4
5666520
入力例 5
1 1000000000 100 1000000000 1000000
出力例 5
0
Score : 233 pts
Problem Statement
Takahashi works as a freelance programmer. He currently has N projects, each numbered from 1 to N.
Project i is expected to take D_i days until delivery, and upon completion of delivery, he will receive a reward of V_i yen.
Takahashi acquires projects through an agent company. Due to his contract with the agent company, he must pay P percent of the total received rewards to the agent company as a commission fee.
Takahashi is trying to calculate his income and expenses for the next M days. Find the amount obtained by subtracting the agent company's commission fee from the total rewards of projects whose delivery is completed within M days.
Note that the answer should be output as an integer with the decimal part truncated (rounded down).
Constraints
- 1 \leq N \leq 2 \times 10^5
- 1 \leq M \leq 10^9
- 0 \leq P \leq 100
- 1 \leq D_i \leq 10^9
- 1 \leq V_i \leq 10^6
- All inputs are integers
Input
N M P D_1 V_1 D_2 V_2 : D_N V_N
- The first line contains N representing the number of projects, M representing the number of days in the planning period, and P representing the commission rate (in percent), separated by spaces.
- From the 2nd line to the (N + 1)-th line, information about each project is given over N lines.
- The (1 + i)-th line contains D_i, the number of days until delivery of project i, and V_i, the reward, separated by spaces.
Output
Output in a single line the amount obtained by subtracting the commission fee from the total rewards of projects whose delivery is completed within M days, as an integer with the decimal part truncated (rounded down).
Sample Input 1
4 5 10 3 1000 5 2000 6 3000 1 500
Sample Output 1
3150
Sample Input 2
3 2 20 3 100 5 200 10 300
Sample Output 2
0
Sample Input 3
10 30 15 10 12000 30 25000 31 40000 5 8000 25 15000 60 50000 1 3000 29 22000 45 18000 30 7000
Sample Output 3
78200
Sample Input 4
30 500 37 120 450000 800 320000 499 100000 500 999999 501 250000 30 75000 365 640000 1000 120000 250 333333 490 222222 10 1000000 700 111111 450 555555 600 444444 1 123456 499 654321 502 98765 300 777777 200 888888 550 99999 400 135790 480 246800 90 112233 510 445566 20 778899 470 314159 900 271828 350 161803 500 424242 750 202020
Sample Output 4
5666520
Sample Input 5
1 1000000000 100 1000000000 1000000
Sample Output 5
0