#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
double f[2001][2001];
double da[2001];
int n,k;
void pre()
{
k=n*k;
if(k%100!=0)k+=100-(k%100);
k/=100;
return;
}
long long getsum(long long num) {
long long now = 1;
if (!num) return 0;
long long sum = 1;
for (int i = 2; i <= 19; i++) {
now *= 10;
if (now > num) {
return sum; }
if (now * 2 > num) {
return sum + num - now + 1;
}
sum += now;
}
}
void work(long long l,long long r,int step)
{
double qwq=(r-l+1),QAQ;
QAQ=getsum(r)-getsum(l-1);
da[step]=QAQ/qwq;
return ;
}
int main()
{
freopen("vangame.in","r",stdin);freopen("vangame.out","w",stdout);
scanf("%d%d",&n,&k);
pre();
for(int i=1;i<=n;i++)
{
long long l,r;
scanf("%lld%lld",&l,&r);
work(l,r,i);
}
f[0][0]=1;
for(int i=1;i<=n;i++)
for(int j=0;j<=i;j++)
f[i][j]=f[i-1][j]*(1-da[i])+f[i-1][j-1]*da[i];
double ans=0;
for(int i=k;i<=n;i++)
ans+=f[n][i];
printf("%.7lf",ans);
return 0;
}