Problem Set Construction

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You are a judge, constructing a problem set for a contest. You have a pool of candidate problems. For each problem, you've found the probability that a team is able to solve the problem, and the time it will take them to implement the solution if they are able to solve it. All implementation times are distinct.

You know the strategy that all teams will take when confronted with a problem set. First, they will determine the set of problems they can solve (assume they can do this instantly at the beginning of the contest). Then, they will solve as many of those problems as they can under the time limit. If there are many subsets of problems they can solve under the time limit, they will first break ties by the number of problems they can solve, next they will break ties by minimizing the total time it will take to solve all of those problems.

Define the Difficulty of a problem to be the probability that a team will solve the problem if it is included in a problem set of size kk along with k1k-1 other problems chosen uniformly at random from the pool. Find the Difficulties of all the problems.

입력

The first line of input contains three integers nn, kk (1kn501 \le k \le n \le 50) and tt (1t25001 \le t \le 2500), where nn is the number of problems in the pool, kk is the number of problems to be chosen for the set, and tt is the time limit of the contest.

Each of the next nn lines contains a real number pp (0.0p1.00.0 \le p \le 1.0) and an integer ss (1st1 \le s \le t) describing a problem, where pp is the probability that a team is able to solve it, and ss is the time to solve. The probabilities will have at most four decimal digits. All times to solve will be distinct.

출력

Output nn lines, each containing a real number which is the Difficulty of the given problem in the order of the input. Each value must be accurate to within an absolute or relative error of 10610^{-6}.