#include <bits/stdc++.h>
using namespace std;
int n, k;
double wcz;
long double sum[200007];
long double rev[200007];
long double pre[200007];
long double inf;
long double dpo[200007];
long double dpn[200007];
long double x[200007];
long double y[200007];
int l;
vector <int> sta;
inline long double vec(int s, int a, int b)
{
return (x[a]-x[s])*(y[b]-y[s])-(x[b]-x[s])*(y[a]-y[s]);
}
int main()
{
inf=1000000000.0;
inf*=inf;
scanf("%d%d", &n, &k);
for (int i=1; i<=n; i++)
{
scanf("%lf", &wcz);
sum[i]=wcz;
pre[i]=pre[i-1]+sum[i-1]/sum[i]+1.0;
rev[i]=1.0/sum[i]+rev[i-1];
sum[i]+=sum[i-1];
}
for (int i=1; i<=n; i++)
{
dpn[i]=pre[i];
}
for (int h=2; h<=k; h++)
{
for (int i=0; i<=n; i++)
{
dpo[i]=dpn[i];
dpn[i]=pre[i];
x[i]=dpo[i]+rev[i]*sum[i]-pre[i];
y[i]=sum[i];
}
sta.clear();
l=0;
for (int i=1; i<=n; i++)
{
while(sta.size()>1 && vec(sta[sta.size()-2], sta[sta.size()-1], i-1)>=0)
sta.pop_back();
l=min(l, (int)sta.size()-1);
l=max(l, 0);
sta.push_back(i-1);
while(l+1<sta.size() && 1*x[sta[l+1]]-rev[i]*y[sta[l+1]]<=1*x[sta[l]]-rev[i]*y[sta[l]])
l++;
dpn[i]+=1*x[sta[l]]-rev[i]*y[sta[l]];
}
}
printf("%.10lf\n", (double)dpn[n]);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbiwgazsKCmRvdWJsZSB3Y3o7Cgpsb25nIGRvdWJsZSBzdW1bMjAwMDA3XTsKbG9uZyBkb3VibGUgcmV2WzIwMDAwN107CmxvbmcgZG91YmxlIHByZVsyMDAwMDddOwoKbG9uZyBkb3VibGUgaW5mOwoKbG9uZyBkb3VibGUgZHBvWzIwMDAwN107CmxvbmcgZG91YmxlIGRwblsyMDAwMDddOwoKbG9uZyBkb3VibGUgeFsyMDAwMDddOwpsb25nIGRvdWJsZSB5WzIwMDAwN107CgppbnQgbDsKdmVjdG9yIDxpbnQ+IHN0YTsKCmlubGluZSBsb25nIGRvdWJsZSB2ZWMoaW50IHMsIGludCBhLCBpbnQgYikKewogICAgcmV0dXJuICh4W2FdLXhbc10pKih5W2JdLXlbc10pLSh4W2JdLXhbc10pKih5W2FdLXlbc10pOwp9CgppbnQgbWFpbigpCnsKICAgIGluZj0xMDAwMDAwMDAwLjA7CiAgICBpbmYqPWluZjsKICAgIHNjYW5mKCIlZCVkIiwgJm4sICZrKTsKICAgIGZvciAoaW50IGk9MTsgaTw9bjsgaSsrKQogICAgewogICAgICAgIHNjYW5mKCIlbGYiLCAmd2N6KTsKICAgICAgICBzdW1baV09d2N6OwogICAgICAgIHByZVtpXT1wcmVbaS0xXStzdW1baS0xXS9zdW1baV0rMS4wOwogICAgICAgIHJldltpXT0xLjAvc3VtW2ldK3JldltpLTFdOwogICAgICAgIHN1bVtpXSs9c3VtW2ktMV07CiAgICB9CiAgICBmb3IgKGludCBpPTE7IGk8PW47IGkrKykKICAgIHsKICAgICAgICBkcG5baV09cHJlW2ldOwogICAgfQogICAgZm9yIChpbnQgaD0yOyBoPD1rOyBoKyspCiAgICB7CiAgICAgICAgZm9yIChpbnQgaT0wOyBpPD1uOyBpKyspCiAgICAgICAgewogICAgICAgICAgICBkcG9baV09ZHBuW2ldOwogICAgICAgICAgICBkcG5baV09cHJlW2ldOwoKICAgICAgICAgICAgeFtpXT1kcG9baV0rcmV2W2ldKnN1bVtpXS1wcmVbaV07CiAgICAgICAgICAgIHlbaV09c3VtW2ldOwogICAgICAgIH0KICAgICAgICBzdGEuY2xlYXIoKTsKICAgICAgICBsPTA7CiAgICAgICAgZm9yIChpbnQgaT0xOyBpPD1uOyBpKyspCiAgICAgICAgewogICAgICAgICAgICB3aGlsZShzdGEuc2l6ZSgpPjEgJiYgdmVjKHN0YVtzdGEuc2l6ZSgpLTJdLCBzdGFbc3RhLnNpemUoKS0xXSwgaS0xKT49MCkKICAgICAgICAgICAgc3RhLnBvcF9iYWNrKCk7CiAgICAgICAgICAgIGw9bWluKGwsIChpbnQpc3RhLnNpemUoKS0xKTsKICAgICAgICAgICAgbD1tYXgobCwgMCk7CiAgICAgICAgICAgIHN0YS5wdXNoX2JhY2soaS0xKTsKICAgICAgICAgICAgd2hpbGUobCsxPHN0YS5zaXplKCkgJiYgMSp4W3N0YVtsKzFdXS1yZXZbaV0qeVtzdGFbbCsxXV08PTEqeFtzdGFbbF1dLXJldltpXSp5W3N0YVtsXV0pCiAgICAgICAgICAgIGwrKzsKICAgICAgICAgICAgZHBuW2ldKz0xKnhbc3RhW2xdXS1yZXZbaV0qeVtzdGFbbF1dOwogICAgICAgIH0KICAgIH0KICAgIHByaW50ZigiJS4xMGxmXG4iLCAoZG91YmxlKWRwbltuXSk7CiAgICByZXR1cm4gMDsKfQ==