import java.io.*; import java.math.*; import java.time.*; import java.util.*; import java.util.Map.Entry; import java.util.stream.Collectors; class Main implements Runnable { public static void solve () { int k = nextInt(); //これまでの目の合計がiのとき、あと何回振ればKに達するか double[] dp = new double[100]; Arrays.fill(dp, 0); double p = 1.0 / 6.0; for (int i=k-1; i>=0; i--) { for (int j=1; j<=6; j++) { dp[i] += (1.0 + dp[i+j]) * p; } } println(dp[0]); } /* * ############################################################################################ * # useful fields, useful methods, useful class * ############################################################################################ */ // fields public static final int infi = (int)1e9; public static final long infl = (long)1e18; public static final int modi = (int)1e9 + 7; public static final long modl = (long)1e18 + 7; // public static int[] dy = {-1, 0, 1, 0}; // public static int[] dx = {0, 1, 0, -1}; // public static int[] dy = {-1, 0, -1, 1, 0, 1}; // public static int[] dx = {-1, -1, 0, 0, 1, 1}; // public static int[] dy = {-1, -1, -1, 0, 1, 1, 1, 0}; // public static int[] dx = {-1, 0, 1, 1, 1, 0, -1, -1}; // methods public static int min (int... a) {Arrays.sort(a); return a[0];} public static int max (int... a) {Arrays.sort(a); return a[a.length-1];} public static long min (long... a) {Arrays.sort(a); return a[0];} public static long max (long... a) {Arrays.sort(a); return a[a.length-1];} public static long pow (long c, long b) { long res = 1; for (int i=0; i { int id, from, to, cost; Edge(int to, int cost) { //基本コレ this.to = to; this.cost = cost; } Edge(int from, int to, int cost) { this.from = from; this.to = to; this.cost = cost; } Edge(int id, int from, int to, int cost) { this.id = id; this.from = from; this.to = to; this.cost = cost; } @Override public int compareTo (Edge e) { return e.cost - this.cost; } } /* * ############################################################################################## * # input * ############################################################################################## */ // input - fields public static final InputStream in = System.in; public static final byte[] buffer = new byte[1024]; public static int ptr = 0; public static int bufferLength = 0; // input - basic methods public static boolean hasNextByte() { if (ptr < bufferLength) { return true; } else { ptr = 0; try { bufferLength = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (bufferLength <= 0) { return false; } } return true; } public static int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1; } public static boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } public static void skipUnprintable() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; } public static boolean hasNext() { skipUnprintable(); return hasNextByte(); } // input - single public static String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public static int nextInt() { return (int) nextLong(); } public static long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while (true) { if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; } else if (b == -1 || !isPrintableChar(b)) { return minus ? -n : n; } else { throw new NumberFormatException(); } b = readByte(); } } public static double nextDouble() { return Double.parseDouble(next()); } // input - array public static String[] nextStringArray(int n) { String[] array = new String[n]; for (int i = 0; i < n; i++) array[i] = next(); return array; } public static int[] nextIntArray(int n) { int[] array = new int[n]; for (int i = 0; i < n; i++) array[i] = nextInt(); return array; } public static long[] nextLongArray(int n) { long[] array = new long[n]; for (int i = 0; i < n; i++) array[i] = nextLong(); return array; } public static double[] nextDoubleArray(int n) { double[] array = new double[n]; for (int i = 0; i < n; i++) { array[i] = nextDouble(); } return array; } // input - table public static char[][] nextCharTable(int h, int w) { char[][] array = new char[h][w]; for (int i = 0; i < h; i++) array[i] = next().toCharArray(); return array; } public static int[][] nextIntTable(int h, int w) { int[][] a = new int[h][]; for (int i=0; i