#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
typedef struct node
{
int price;
double bb;
}Node;
Node a[1005];
bool cmp(Node a,Node b)
{
if(a.bb != b.bb)
return a.bb < b.bb;
else
return a.price < b.price;
}
int main()
{
int n,m;
while(cin>>n>>m)
{
if(n == 0 && m == 0)
break;
int i;
for(i = 1;i <= m;i++)
{
cin>>a[i].price>>a[i].bb;
a[i].bb = 1.0-a[i].bb;
}
sort(a+1,a+m+1,cmp);
int mon = 0;
double sum = 1.0;
for(i = 1;i <= m;i++)
{
if(mon + a[i].price <= n)
{
mon = mon + a[i].price;
sum = sum * a[i].bb;
}
}
sum = (1-sum)*100;
printf("%.1lf%%\n",sum);
}
return 0;
}