#BS0000403. Pha nước muối (Salt)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Pha nước muối (Salt)
Salt
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Takahashi has containers of salt solution, numbered from 1 to . Container holds grams of solution with salt concentration percent by mass, hence grams of salt. He chooses exactly containers and mixes all their contents. Find the greatest achievable concentration as a percentage.
Input
The first line contains integers . Line of the next lines contains integers , the mass in grams and percentage concentration of container .
Output
Print the greatest concentration as a real percentage. The absolute error must not exceed .
Subtasks
- Subtask 1 (20 points): ; ; for every . .
- Subtask 2 (30 points): ; ; for every . .
- Subtask 3 (50 points): ; ; for every .
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 , , and . Containers 1 and 3 achieve the maximum of 25 percent.