package no472; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { public static int INF = (int) 1e9; public static void main(String[] args) { ValidatingScanner sc = new ValidatingScanner(true); int n = sc.readInt(1, 5000); sc.readSpace(); int p = sc.readInt(0, 3*n); sc.readEoln(); int[][] rank = new int[n][4]; for(int i=0;i=0;j--) { int next = INF; for(int k=0;k<=3;k++) { if (j - k < 0) { break; } next = Math.min(next, dp[j-k] + rank[i][k]); } dp[j] = next; } // System.out.println(Arrays.toString(dp)); } System.out.println(String.format("%.6f", (double) dp[p] / n)); } } class ValidatingScanner { boolean strictEoln = false; public static final String EOLN = "\n"; private final InputStream in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; public ValidatingScanner(boolean strictEoln) { this(System.in, strictEoln); } public ValidatingScanner(InputStream source, boolean strictEoln) { this.in = source; this.strictEoln = strictEoln; } private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } public boolean eof() { return !hasNextByte(); } private int getByte() { if (hasNextByte()) { return buffer[ptr]; }else{ return -1; } } private int readByte() { if (hasNextByte()) { return buffer[ptr++]; }else{ return -1; } } private void advance() { if (hasNextByte()) { ptr++; } } private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} public long readLong() { if (eof()) { throw new NoSuchElementException(); } long n = 0; boolean minus = false; int b = getByte(); if (b == '-') { advance(); minus = true; b = getByte(); } if (b < '0' || '9' < b) { throw new InputMismatchException(); } while(true){ if ('0' <= b && b <= '9') { try { n = Math.multiplyExact(n, 10); } catch (ArithmeticException e) { throw new InputMismatchException(); } n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new InputMismatchException(); } advance(); b = getByte(); } } public int readInt() { long nl = readLong(); if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) { throw new InputMismatchException(); } return (int) nl; } public int readInt(int min,int max) { if (min > max) throw new IllegalArgumentException(); int n = readInt(); if (n < min || n > max) throw new InputMismatchException(); return n; } public void readSpace() { int b = readByte(); if (b != ' ') throw new InputMismatchException(); } public void readEoln() { if (strictEoln) { for(int i=0;i