#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>s; Int n=s.size(); map pos; double ans=0; for(Int i=0;i vs; for(auto p:pos) vs.emplace_back(p.second); sort(vs.rbegin(),vs.rend()); vs.emplace_back(-1); for(Int j=0;j+1<(Int)vs.size();j++){ ans+=(vs[j]-vs[j+1])*(j+1); } } ans/=(double)n*(n+1)/2; cout<