【Codeforces Round #460 (Div. 2) A】 Supermarket

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

就是让你求m*(ai/bb)的最小值

【代码】

#include <bits/stdc++.h>
#define double long double
using namespace std;

int n,m;

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
    cin >> n >> m;
    double ans = -1;
    for (int i = 1;i <= n;i++){
        double a,b;
        cin >> a >> b;
        if (i==1){
            ans = 1.0*m*(a/b);
        }else ans = min(ans,1.0*m*(a/b));
    }
    cout << fixed<<setprecision(10)<<ans << endl;
	return 0;
}
原文地址:https://www.cnblogs.com/AWCXV/p/8396427.html