1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <cstdio> #include <cstdlib> #include <cmath> #include <algorithm> #include <cstring> using namespace std; long long n,a1,b1,ans,wealth; struct { long long a,b,w; }c[10010]; bool cmp(node x,node y){ if(x.a*x.b==y.a*y.b) return 1; return x.a*x.b>y.a*y.b; } int main(){ cin>>n>>a1>>b1; wealth=a1; for(long long i=0;i<n;i++) cin>>c[i].a>>c[i].b; sort(c,c+n,cmp); for(long long i=n-1;i>0;i--) wealth*=c[i].a; wealth/=c[0].b; cout<<wealth<<endl; return 0; }
|
近期评论