poj3686 The Windy's(真没想到poj上的题目描述都这么迷)

译文:
问题描述
岚是世界著名的玩具工厂,拥有M个一流的车间制造玩具。
今年经理收到N个玩具的订单。经理知道每个订单在不同的车间需要不同的时间来制造。更准确地说,第i个订单在第j个车间制造,就需要Z[i][j]个小时。此外,每个订单必须完全在同一车间完成。车间不能中途换订单,必须先把手上的订单完成才行。订单的切换不需要任何时间。
经理想要最小化完成N个任务的平均时间。
你能帮助他吗?

输入
第一行是测试点的数量。每个测试点的第一行包含两个整数,N和M(1≤N M≤50)(M个车间,N个任务)。
接下来的N行每个包含整数,描述矩阵Z[i]j每个测试点之前有一个空行。

输出
对于每一个测试点,输出单独一行表示答案
答案保留六位小数。

样例输入
3

3 4
100 100 100 1
99 99 99 1
98 98 98 1

3 4
1 100 100 100
99 1 99 99
98 98 1 98

3 4
1 100 100 100
1 99 99 99
98 1 98 98

样例输出
2.000000
1.000000
1.333333

原文:
Description
The Windy’s is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take different amount of hours in different workshops. More precisely, the i-th order will take Zij hours if the toys are making in the j-th workshop. Moreover, each order’s work must be wholly completed in the same workshop. And a workshop can not switch to another order until it has finished the previous one. The switch does not cost any time.

The manager wants to minimize the average of the finishing time of the N orders. Can you help him?

Input
The first line of input is the number of test case. The first line of each test case contains two integers, N and M (1 ≤ N,M ≤ 50).
The next N lines each contain M integers, describing the matrix Zij (1 ≤ Zij ≤ 100,000) There is a blank line before each test case.

Output
For each test case output the answer on a single line. The result should be rounded to six decimal places.

Sample Input
3
3 4
100 100 100 1
99 99 99 1
98 98 98 1
3 4
1 100 100 100
99 1 99 99
98 98 1 98
3 4
1 100 100 100
1 99 99 99
98 1 98 98

Sample Output
2.000000
1.000000
1.333333

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值