QOJ.ac

QOJ

时间限制: 5 s 内存限制: 1024 MB 总分: 100

#10533. 展览

统计

市政府正在筹划一场展览并收集工业产品。共有 $n$ 个工业产品候选者,市政府决定从中选择 $k$ 个。他们希望最小化这 $k$ 个产品的总价格。然而,还需要考虑尺寸和重量等其他标准。为了解决这个问题,市政府决定采用以下策略:第 $i$ 个产品有三个参数:价格 $x_i$、尺寸 $y_i$ 和重量 $z_i$。市政府选择 $k$ 个项目 $i_1, \dots, i_k$ ($1 \le i_j \le n$),使得评估指标 $$e = \left(\sum_{j=1}^k x_{i_j}\right) \left(\sum_{j=1}^k y_{i_j}\right) \left(\sum_{j=1}^k z_{i_j}\right)$$ 最小化。该指标综合了产品的价格、尺寸和重量。如果有两个或多个选择都能使 $e$ 达到最小,政府将从中随机均匀选择一个。

你所在的公司生产产品 1。公司决定降低产品 1 的价格、尺寸和/或重量,以便市政府有可能选择你们公司的产品,即让选择该产品的概率大于零。我们有三个参数 $A, B$ 和 $C$。如果我们想将价格、尺寸和重量分别降低到 $(1-\alpha)x_1, (1-\beta)y_1$ 和 $(1-\gamma)z_1$ ($0 \le \alpha, \beta, \gamma \le 1$),则需要投入 $\alpha A + \beta B + \gamma C$ 百万日元。注意,调整后的价格、尺寸和重量不必为整数。你的任务是计算使市政府有可能选择你们公司产品所需的最小投资额。你可以假设所有其他公司的员工都太懒了,不会做出这样的努力。

输入格式

输入包含单个测试用例,格式如下:

$n \ k \ A \ B \ C$ $x_1 \ y_1 \ z_1$ $x_2 \ y_2 \ z_2$ $\vdots$ $x_n \ y_n \ z_n$

第一行包含五个整数。整数 $n$ ($1 \le n \le 50$) 是工业产品的数量,整数 $k$ ($1 \le k \le n$) 是市政府将要选择的产品数量。整数 $A, B, C$ ($1 \le A, B, C \le 100$) 是决定产品 1 价格、尺寸和重量调整成本的参数。

接下来的 $n$ 行,每行包含三个整数 $x_i, y_i, z_i$ ($1 \le x_i, y_i, z_i \le 100$),分别是第 $i$ 个产品的价格、尺寸和重量。

输出格式

输出使市政府有可能选择你们公司产品所需的最小成本(单位:百万日元)。输出的绝对误差不应超过 $10^{-4}$。

样例

样例输入 1

6 5 1 2 3
5 5 5
1 5 5
2 5 4
3 5 3
4 5 2
5 5 1

样例输出 1

0.631579

样例输入 2

6 1 1 2 3
10 20 30
1 2 3
2 4 6
3 6 9
4 8 12
5 10 15

样例输出 2

0.999000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.