using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.Threading.Tasks; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ N = S.Length; //double ret = 0; //var sw = new Stopwatch(); //sw.Start(); //var t0 = sw.ElapsedMilliseconds; var ret = new long[26]; Parallel.For(1,27,len => { ret[len - 1] += calc(len); //Console.WriteLine("i:{0}, {1} [ms]",i, sw.ElapsedMilliseconds - t0); }); //Console.WriteLine("{0} [ms]",sw.ElapsedMilliseconds - t0); double tot = (double) N * (double) (N + 1) / 2.0; Console.WriteLine((double) ret.Sum() / tot); //Console.WriteLine(ret); } long calc(int len){ var dl = new Dictionary(); int l = 0; var dr = new Dictionary(); int r = 0; long cnt = 0; for(int i=0;iint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }