#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;
long double arr[500010];
int n;
long double k;
int main()
{
cin >> n >> k;
for (int i = 1;i <= n;i++)
{
cin >> arr[i];
}
long double ave = k / n;
sort(arr + 1, arr + 1 + n);
long double ans = 0;
for (int i = 1;i <= n;i++)
{
long double t = k / (n + 1 - i);
if (arr[i] < t)t = arr[i];
ans += ((t - ave) * (t - ave))/n;
k -= t;
}
printf("%.4Lf", sqrt(ans));
return 0;
}
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
string str;
int ans = 1000000;
int a = 0;
int b = 0;
int t = 0;
void function1(char c1, char c2, char c3, int n1, int n2, int n3)
{
int c12 = 0;
int c13 = 0;
int c21 = 0;
int c23 = 0;
int c31 = 0;
int c32 = 0;
for (int i = 0;i < n1;i++)
{
if (str[i] == c2)
{
c12++;
}
else if (str[i] == c3)
{
c13++;
}
}
for (int i = n1;i < n1 + n2;i++)
{
if (str[i] == c1)
{
c21++;
}
else if (str[i] == c3)
{
c23++;
}
}
for (int i = n1 + n2;i < n1 + n2 + n3;i++)
{
if (str[i] == c1)
{
c31++;
}
else if (str[i] == c2)
{
c32++;
}
}
int res = 0;
res += min(c31, c13);
res += min(c12, c21);
res += min(c23, c32);
res += (abs(c31 - c13))*2;
ans = min(ans, res);
//cout << c1 << c2 << c3 << res << endl;
}
int main()
{
cin >> str;
for (int i = 0;i < str.size();i++)
{
if (str[i] == 'A')
{
a++;
}
else if (str[i] == 'B')
{
b++;
}
else
{
t++;
}
}
//tab
function1('T', 'A', 'B', t, a, b);
//tba
function1('T', 'B', 'A', t, b, a);
//abt
function1('A', 'B', 'T', a, b, t);
//atb
function1('A', 'T', 'B', a, t, b);
//bat
function1('B', 'A', 'T', b, a, t);
//bta
function1('B', 'T', 'A', b, t, a);
cout << ans << endl;
return 0;
}
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int f[1010][1010];
int main()
{
string str1;
cin >> str1;
string str2;
str2.resize(str1.size());
for (int i = 0;i < str1.size();i++)
{
str2[i] = str1[str1.size() - 1 - i];
}
//cout << str1 << endl << str2 << endl;
int res = 0;
for (int i = 1;i <= str1.size();i++)
{
for (int j = 1;j <= str2.size();j++)
{
if (str1[i-1] != str2[j-1])
{
f[i][j] = max(f[i - 1][j], f[i][j - 1]);
}
else
{
f[i][j] = f[i - 1][j - 1]+1;
}
}
}
cout << str1.size() - f[str1.size()][str1.size()] << endl;
return 0;
}