A. Supermarket

time limit per test2 seconds

memory limit per test256 megabytes

Problem Description

We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that a yuan for b kilos (You don’t need to care about what “yuan” is), the same as a / b yuan for a kilo.

Now imagine you’d like to buy m kilos of apples. You’ve asked n supermarkets and got the prices. Find the minimum cost for those apples.

You can assume that there are enough apples in all supermarkets.

Input

The first line contains two positive integers n and m (1 ≤ n ≤ 5 000, 1 ≤ m ≤ 100), denoting that there are n supermarkets and you want to buy m kilos of apples.

The following n lines describe the information of the supermarkets. Each line contains two positive integers a, b (1 ≤ a, b ≤ 100), denoting that in this supermarket, you are supposed to pay a yuan for b kilos of apples.

Output

The only line, denoting the minimum cost for m kilos of apples. Please make sure that the absolute or relative error between your answer and the correct answer won’t exceed 10 - 6.

Formally, let your answer be x, and the jury’s answer be y. Your answer is considered correct if .

Examples

input

3 5

1 2

3 4

1 3

output

1.66666667

input

2 1

99 100

98 99

output

0.98989899


解题心得:

  1. 一个水题,注意精度问题就可以轻松过了。

#include<bits/stdc++.h>
using namespace std;
int main()
{
double ans,a,b,m;
int n;
scanf("%d%lf",&n,&m);
ans = 10000000.0;
for(int i=0;i<n;i++)
{
scanf("%lf%lf",&a,&b);
ans = min(ans,m*a/b);
}
printf("%.8f",ans);
return 0;
}

最新文章

  1. python 学习笔记 -logging模块(日志)
  2. Get-FilewithExtension
  3. 深度学习 - DL
  4. C++中的4个类型转换关键字
  5. Python时区转换
  6. 利用bak文件恢复数据库问题小结
  7. bash可改动的环境变量
  8. 如何“任性”使用Android的drawText()
  9. 数组排序-Objectivec
  10. windows c++程序移植到linux的要点
  11. 51-迷宫(一)- java版dfs和bfs
  12. topcoder srm 570 div1
  13. Python崛起:“人生苦短,我用Python”并非一句戏言
  14. Linux第七周学习总结——可执行程序的装载
  15. WordPress主题开发:循环代码
  16. Javascript中的继承与Prototype
  17. 配置idea
  18. C/C++ 获取目录下的文件列表信息
  19. [LeetCode] 数学计算模拟类问题:加法,除法和幂,注意越界问题。题 剑指Offer,Pow(x, n) ,Divide Two Integers
  20. vue 阻止表单默认事件

热门文章

  1. pat1055. The World&#39;s Richest (25)
  2. SpringBoot | 第二十六章:邮件发送
  3. C 碎片六 函数
  4. 在spark2中的shell使用python3
  5. css清除浮动好方法
  6. Eucalyptus(v4.0)系统需求
  7. Dll注入:Windows消息钩子注入
  8. [Asp.Net] web api 部署注意事项
  9. 金庸和古龙,Netweaver和微服务,以及SAP Hybris Revenue Cloud
  10. cesium加载shp格式数据