PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000403. Pha nước muối (Salt)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Pha nước muối (Salt)

Salt

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Takahashi has nn containers of salt solution, numbered from 1 to nn. Container ii holds wiw_i grams of solution with salt concentration pip_i percent by mass, hence wipi/100w_ip_i/100 grams of salt. He chooses exactly kk containers and mixes all their contents. Find the greatest achievable concentration as a percentage.

Input

The first line contains integers n,kn,k. Line ii of the next nn lines contains integers wi,piw_i,p_i, the mass in grams and percentage concentration of container ii.

Output

Print the greatest concentration as a real percentage. The absolute error must not exceed 10−610^{-6}.

Subtasks

  • Subtask 1 (20 points): 1≤k≤n≤10001\le k\le n\le1000; 1≤wi≤1091\le w_i\le10^9; 0≤pi≤1000\le p_i\le100 for every 1≤i≤n1\le i\le n. k=1k=1.
  • Subtask 2 (30 points): 1≤k≤n≤10001\le k\le n\le1000; 1≤wi≤1091\le w_i\le10^9; 0≤pi≤1000\le p_i\le100 for every 1≤i≤n1\le i\le n. k≤2k\le2.
  • Subtask 3 (50 points): 1≤k≤n≤10001\le k\le n\le1000; 1≤wi≤1091\le w_i\le10^9; 0≤pi≤1000\le p_i\le100 for every 1≤i≤n1\le i\le n.

Examples

Input

3 2
100 15
300 20
200 30

Output

25.000000000

Explanation

Containers 1, 2, 3 hold 15, 60, 60 grams of salt. The three choices give 75/400⋅100=18.7575/400\cdot100=18.75, 75/300⋅100=2575/300\cdot100=25, and 120/500⋅100=24120/500\cdot100=24. Containers 1 and 3 achieve the maximum of 25 percent.