#include <iostream>
#include <cstdio>
using namespace std;
#define N 10005
double maxx(double as,double bs)
{
return as>bs?as:bs;
}
double ar[N];
int a[N];
double b[N];
void init()
{
int n,m;
while(scanf("%d%d",&n,&m)!=EOF)
{
if(n==0&&m==0) break;
for(int i=0;i<m;i++)
scanf("%d%lf",&a[i],&b[i]);
memset(ar,0.0,sizeof(ar));
for(int i=0;i<m;i++)
{
for(int j=n;j>=a[i];j--)
ar[j] = maxx(1.0 - (1-ar[j-a[i]])*(1-b[i]),ar[j]);
}
ar[n]*=100;
printf("%.1lf%%\n",ar[n]);
}
}
int main()
{
init();
return 0;
}
hdu 1203
最新推荐文章于 2020-05-27 16:10:00 发布