using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static int N, K; static long[] Tcnt = new long[61], Zcnt = new long[61]; static void Main() { N = int.Parse(Console.ReadLine()); K = int.Parse(Console.ReadLine()); calc(); long cnt = 0; for(int i = 1; i < 60; i++) { for(int j = i + 1; j <= 60; j++) { cnt += Tcnt[j] * Zcnt[i]; } } Console.WriteLine((double)cnt / (Tcnt.Sum() * Zcnt.Sum())); } static void calc() { int loop =(int) Math.Pow(6, N); for(int i = 0; i < loop; i++) { int c = i; int T=0, Z = 0; for(int j = 0; j < N; j++) { int d = c % 6; if (d == 0) { d = 6; } Z += d; if (K - 1 > j) { T += (3 + (d + 1) / 2); } else { T += d; } c /= 6; } Tcnt[T]++; Zcnt[Z]++; } } }