#P8812. [蓝桥杯 2022 国 C] 打折
[蓝桥杯 2022 国 C] 打折
Problem Description
Xiao Lan plans to buy types of items, and he needs of each type.
There are shops near where Xiao Lan lives, and each shop sells various items.
Shop offers a discount from day to day , with a discount rate . For an item with original price , the discounted price is . At other times, the item must be bought at the original price.
Xiao Lan is very busy, so he can only choose one day to buy all the items. What is the minimum amount of money he needs to spend to buy all the required items.
It is guaranteed that Xiao Lan can buy all the items he needs.
Input Format
The first line contains two integers , separated by a space, representing the number of item types and the number of shops.
Next come the descriptions of the shops in order. Each shop consists of several lines. The first line contains four integers , separated by spaces, representing the start and end time of the shop’s discount, the discount rate, and the total number of products in the shop. Then follow lines, each containing two integers , separated by a space, representing the type and the price of the -th product in the shop. Item types are numbered from to .
Output Format
Output one line containing one integer, indicating the minimum amount of money Xiao Lan needs to spend.
2 2
1 2 89 1
1 97
3 4 77 1
2 15
101
Hint
For of the testdata, , , .
For of the testdata, , .
For all testdata, , , , , , , .
Lanqiao Cup 2022 National Contest, Group C, Problem I.
Translated by ChatGPT 5