fatmouse prepared m pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, javabean. the warehouse has n rooms. the i-th room contains j[i] pounds of javabeans and requires f[i] pounds of cat food. fatmouse does not have to trade for all the javabeans in the room, instead, he may get j[i]* a% pounds of javabeans if he pays f[i]* a% pounds of cat food. here a is a real number. now he is assigning this homework to you: tell him the maximum amount of javabeans he can obtain.
时间: 2023-05-01 19:04:28 浏览: 150
贪心与动态规划专题(一)
这道题目的意思是,fatmouse准备了m磅猫粮,他想用这些猫粮与守卫着javabean仓库的猫们交换他最喜欢的javabean。仓库里有n个房间,第i个房间里有j[i]磅javabean,交换需要f[i]磅猫粮。fatmouse并不需要交换房间里所有的javabean,他可以支付f[i]*a%磅猫粮来获得j[i]*a%磅javabean。现在他想知道他最多能获得多少javabean的数量,他把这个问题交给了你。
阅读全文