#include#include #include using namespace std;int main(){ int n,m,i,j,w[10000+5]; double k[10000+5],dp[10000+5]; while(~scanf("%d%d",&n,&m)) { if(n==0&&m==0) break; for(i=0;i =w[i];j--) { dp[j]=min(dp[j],dp[j-w[i]]*k[i]); } } dp[n]=1-dp[n]; dp[n]=dp[n]*100; printf("%.1f%%\n",dp[n]); } return 0;}