Server

TimeLimit:10000MS  MemoryLimit:262144KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
Alice and Bob are working on a new assignment. In this project, they need to access some information on a website and monitor this web site for consistent $t$ days. In others words, in each day, there must be at least one server in work. Luckily, they can rent some servers in the lab. According to the schedule, there are totally $N$ servers being available. The $i$-th server can be used from the $S_i$-th day to the $T_i$-th day. However, using the $i$-th server require $A_i$ dollars. After a long time of persuasion, the administrator of the machine room agree to give Alice and Bob discount. Each server is assigned with a discount number $B_i$. If the set of servers they want to use is $S$, they need to pay $\frac{\sum_{i\in S}A_i}{\sum_{i\in S}B_i}$ dollars. As Alice and Bob are preparing the programs on the servers, they want your help to find a way to minimize the cost of servers.
Input
The first line is the number of test cases. For each test case, the first contains two positive integers $N$ and $t$ $(N \leq 100000, t \leq 100000)$ as described above. In the next $N$ lines, the $i$-th line consists of four integer $S_i$, $T_i$, $A_i$, and $B_i$ $(1 \leq S_i \leq T_i \leq t, 0 < A_i, B_i \leq 1000)$.
Output
For each test case, output an float-point number with three decimal places donating the minimum cost Alice and Bob need to pay. It is guaranteed that there is at least one feasible way to rent servers.
SampleInput
1
4 5
1 3 28 1
4 5 22 1
3 5 34 1
1 2 26 1
SampleOutput
25.000
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
出处

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: