这是问题陈述
一个印度农民有一块农田,比如说 L 平方公里长,想要播种小麦或水稻或两者兼而有之。农民有有限数量的 F 公斤化肥和 P 公斤杀虫剂。
每平方公里小麦需要 F1 公斤的肥料和 P1 公斤的杀虫剂。每平方公里水稻种植需要 F2 Kg 肥料和 P2 Kg 杀虫剂。令 S1 为出售一平方公里收获的小麦所获得的价格,而 S2 为出售一平方公里收获的大米所获得的价格。
您必须通过选择应该种植小麦和/或稻米的区域来找到农民可以获得的最大总利润。
例如:
L = 10 Km2,F = 10 Kg,P = 5 Kg,F1 = 2 Kg,P1 = 2 Kg,F2 = 3 Kg,P2 = 1 Kg,S1 = 14,S2 = 25。
在这种情况下,如果农民在 Km2 面积上只播种水稻,则将获得最大利润3.33
,最大利润值为83.33
。
输入格式
唯一的输入将由 9 个以空格分隔的整数组成,L, F, P, F1, P1, F2, P2, S1, S2
约束
1 <= L <= 10^4
1 <= F <= 10^4
1 <= P <= 10^4
F1 + F2< = F
P1 + P2 <= P
1 <= S1 <= 10^4
1 <= S2 <= 10^4
输出格式
输出将是
- 最大利润修正高达 2 位数
- 小麦应种植的公里数 2 位数
- 以km 2 为单位的值,水稻应正确种植最多2 位数字。
对于问题输出中考虑的示例,将是83.33 0.00 3.33
.
示例测试用例
输入
10 10 5 2 2 3 1 14 25
输出
83.33 0.00 3.33
解释
假设 L = 10 Km2,F = 10 Kg,P = 5 Kg,F1 = 2 Kg,P1 = 2 Kg,F2 = 3 Kg,P2 = 1 Kg,S1 = 14,S2 = 25。如果农民在 3.33 平方公里的土地上不种植小麦而种植水稻,则总利润最大,最大利润值为 83.33 。
我需要解决这个问题。但是,无法掌握语句本身。请帮我。