8520: Task Computing

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:Special Judge 上传者:
提交:7 通过:0

题目描述

As it says, Time is Money, Efficiency is Life. A client has a computing task waiting for uploading to the cloud servers. However, due to the resource limits and many other tasks, a task usually cannot be worked on a single server but multiple servers, one after another. You, as an employee of a cloud server provider who specializes in task allocation, need to select several servers from a limited number of cloud servers to perform calculations. We know that even the same servers will perform differently in different environments.
There are n cloud servers available in the vicinity of the client's region numbered from 1 to n. The iii-th cloud server has two parameters: wiw_iwi and pip_ipi, which indicate the computing power and transmission efficiency of that server, respectively. The supervisor requires that each task must be computed by exactly mmm of these servers. The client's computational task is not parallelizable, so you must sequence the work of the mmm servers to maximize the total computational efficiency. We define the total computational efficiency as follows:
i=1mwaij=0i1paj

where a1,a2,…,ama_1,a_2,\ldots, a_ma1,a2,,am (pairwise distinct, 1≤ai≤n1\le a_i \le n1ain) are the servers you selected. For convenience, a0=0,p0=1a_0 = 0, p_0 = 1a0=0,p0=1.

输入格式

The first line contains two integers n,mn,mn,m (1≤n≤1051\le n\le 10^51n105, 1≤m≤min⁡(n,20)1\le m \le \min(n,20)1mmin(n,20)), denoting the number of cloud servers and servers that you have to select.
The second line contains nnn integers w1,w2,…,wnw_1,w_2,\ldots, w_nw1,w2,,wn (1≤wi≤1091\le w_i \le 10^91wi109), denoting the servers' computing power.
The third line contains nnn integers q1,q2,…,qnq_1,q_2,\ldots, q_nq1,q2,,qn (8000≤qi≤120008000\le q_i \le 120008000qi12000), where pi=qi10000p_i = \frac{q_i}{10000}pi=qi/10000 denotes the iii-th server's transmission efficiency.

输出格式

Output a float number denoting the maximal total computational efficiency. Your answer is considered correct if the relative or absolute error between yours and the standard solution is not greater than 10−610^{-6}106.

输入样例 复制

5 2
1 2 3 4 5
12000 11000 10000 9000 8000

输出样例 复制

8.5000000000000000

分类标签