codeparrot/codecomplex huggingface dataset:
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.util.*;
public class Main {
	static int a[][],n;
	static boolean isClique[];
	static int maxClique[];
	static void DFS1(int p,int n,int S)
	{
		if(p>n)
		{
			isClique[S]=true;
			return ;
		}
		DFS1(p+1,n,S);
		boolean mark=true;
		for(int i=1;i<p;++i)
			if((S>>(i-1)&1)==1&&a[p][i]==0)
				mark=false;
		if(mark)
			DFS1(p+1,n,1<<(p-1)|S);
	}
	static void DFS2(int p,int n,int m,int S)
	{
		if(p>n)
		{
			int cnt=0;
			for(int i=m;i<=n;++i)
				if((S>>(i-m)&1)==1)
					++cnt;
			maxClique[S]=cnt;
			return ;
		}
		DFS2(p+1,n,m,S);
		boolean mark=true;
		for(int i=m;i<p;++i)
			if((S>>(i-m)&1)==1&&a[p][i]==0)
				mark=false;
		if(mark)
			DFS2(p+1,n,m,1<<(p-m)|S);
	}
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		n=Integer.parseInt(sc.next());
		a=new int [n+10][n+10];
		int cap=Integer.parseInt(sc.next());
		for(int i=1;i<=n;++i)
			for(int j=1;j<=n;++j)
				a[i][j]=Integer.parseInt(sc.next());
		int m=(n+1)>>1;
		isClique=new boolean [1<<m];
		Arrays.fill(isClique,false);
		DFS1(1,m,0);
		maxClique=new int [1<<(n-m)];
		Arrays.fill(maxClique,0);
		DFS2(m+1,n,m+1,0);
		for(int i=1;i<1<<(n-m);++i)
			for(int j=m+1;j<=n;++j)
				if((i>>(j-m-1)&1)==1)
					maxClique[i]=Math.max(maxClique[i],maxClique[i-(1<<(j-m-1))]);
		int ans=0,tmp[]=new int [m+10];
		for(int i=0;i<1<<m;++i)
			if(isClique[i])
			{
				int mask=0,cnt=0;
				for(int j=1;j<=m;++j)
					if((i>>(j-1)&1)==1)
						tmp[++cnt]=j;
				for(int j=m+1;j<=n;++j)
				{
					boolean mark=true;
					for(int k=1;k<=cnt;++k)
						if(a[j][tmp[k]]==0)
							mark=false;
					if(mark)
						mask|=1<<(j-m-1);
				}
				ans=Math.max(ans,cnt+maxClique[mask]);
			}
		System.out.printf("%.9f\n",cap*cap*(ans-1)/2.0/ans);
	}
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

// 1 -> n/2  XX n/2 + 1 -> n
public class MotherOfDragons
{
	static boolean[][] adjMatrix;
	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
//		for (int i = 1; i <= n; i++)
//			System.err.printf("%d %.12f\n",i, (k*k*((i-1)/(2.0*i))));
		adjMatrix = new boolean[n][n];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				adjMatrix[i][j] = sc.nextInt() == 1;
		
		long[] edges = new long[n];
		for (int i = 0; i < n; i++)
		{
			long val = 0;
			for (int j = 0; j < n; j++)
				if(adjMatrix[i][j] || i == j)
					val |= 1l<<j;
			edges[i] = val;
		}
		
		int h = n/2;
		
		int[] cliques = new int[1<<h];
		for (int i = 1; i < 1<<h; i++)
		{
			int nodes = i;
			for (int j = 0; j < h; j++)
				if((i & (1 << j)) != 0)
					nodes &= edges[j];
			if(nodes == i)
				cliques[i] = Integer.bitCount(i);
		}
		
		for (int i = 1; i < 1<<h; i++)
			for (int j = 0; j < h; j++)
				if((i & (1 << j)) != 0)
					cliques[i] = Math.max(cliques[i], cliques[i ^ (1<<j)]);
		
		int max = 0;
		for (int i = 0; i < cliques.length; i++)
			max = Math.max(max, cliques[i]);
		for (int i = 1; i < 1<<(n-h); i++)
		{
			long all = -1l;
			long tmp = (1l*i)<<h;
			for (int j = h; j < n; j++)
				if((tmp & (1l << j)) != 0)
					all &= edges[j];
			long node = all&tmp;
			if(node != tmp)
				continue;
			int connected = (int)(all & ((1<<h)-1));
			max = Math.max(max, cliques[connected] + Integer.bitCount(i));
		}
		
		System.out.printf("%.12f\n", (k*k*((max-1)/(2.0*max))));
	}
	
	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s)
		{
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String s) throws FileNotFoundException
		{
			br = new BufferedReader(new FileReader(new File((s))));
		}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException
		{
			return br.readLine();
		}

		public double nextDouble() throws IOException
		{ return Double.parseDouble(next()); }	
	}
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.util.*;
import java.io.*;
public class E {
    void solve(BufferedReader in) throws Exception {
        int[] xx = toInts(in.readLine());
        int n = xx[0];
        double k = xx[1];
        int[][] board = new int[n][n];
        for(int i = 0; i<n; i++) board[i] = toInts(in.readLine());
        int fst = n/2;
        int snd = n - fst;
        int[] maxc = new int[1<<fst];
        int max = 1;
        for(int i = 0; i<(1<<fst); i++) {
            for(int j = 0; j<fst; j++) {
                if((i&(1<<j)) != 0) maxc[i] = Math.max(maxc[i], maxc[i^(1<<j)]);
            }
            boolean ok = true;
            for(int a = 0; a<fst; a++) if(((1<<a)&i) != 0) {
                for(int b = a+1; b<fst; b++) if(((1<<b)&i) != 0) {
                    if(board[a][b] == 0) ok = false;
                }
            }
            if(ok) {
                maxc[i] = Integer.bitCount(i);
                max = Math.max(max, maxc[i]);
            }
        }
        for(int i = 0; i<(1<<snd); i++) {
            boolean ok = true;
            for(int a = 0; a<snd; a++) if(((1<<a)&i) != 0) {
                for(int b = a+1; b<snd; b++) if(((1<<b)&i) != 0) {
                    if(board[a+fst][b+fst] == 0) ok = false;
                }
            }
            if(!ok) continue;
            int mask = 0;
            for(int a = 0; a<fst; a++) {
                ok = true;
                for(int b = 0; b<snd; b++) {
                    if(((1<<b)&i) != 0) {
                        if(board[a][b+fst] == 0) ok = false;
                    }
                }
                if(ok) mask |= (1<<a);
            }
            max = Math.max(Integer.bitCount(i) + maxc[mask], max);
        }
        System.out.println(k*k*(max-1.0)/(2*max));
    }
    int toInt(String s) {return Integer.parseInt(s);}
    int[] toInts(String s) {
        String[] a = s.split(" ");
        int[] o = new int[a.length];
        for(int i = 0; i<a.length; i++) o[i] = toInt(a[i]);
        return o;
    }
    void e(Object o) {
        System.err.println(o);
    }
    public static void main(String[] args) throws Exception{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        (new E()).solve(in);
    }
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;



public class ELR {

	static double solveUnweighted (int nodes, long curr, long pool, long excl) {
		if (pool == 0 && excl == 0) {
			int cnt = 0;
			for (int i = 0; i < nodes; i++)
				if ((curr & 1L << i) > 0)
					cnt++;
			
			double cont = (k / (cnt*1.0));
			double edges = (cnt) * (cnt - 1) / 2.0;
			return cont * cont * edges;
		}
		double res = 0;
		int j = 0;
		for (int i = 0; i < nodes; i++)
			if ((pool & 1L << i) > 0 || (excl & 1L << i) > 0)
				j = i;

		for (int i = 0; i < nodes; i++) {
			if ((pool & 1L << i) == 0 || adj[i][j])
				continue;
			long ncurr = curr, npool = 0, nexcl = 0;
			ncurr |= 1L << i;

			for (int k = 0; k < nodes; k++) {
				if (adj[i][k]) {
					npool |= pool & 1L << k;
					nexcl |= excl & 1L << k;
				}
			}
			res = Math.max(res, solveUnweighted(nodes, ncurr, npool, nexcl));

			pool &= ~(1L << i);
			excl |= 1L >> i;
		}
		return res;
	}
	public static void main(String[] args) {new Thread(null, new Runnable() { public void run() {try {
		sol();
	} catch (Throwable e) {
		
		e.printStackTrace();
	}}}, "2",1<<26).start();}
	
	static int n,k;
	static boolean adj[][];
	public static void sol() throws Throwable {
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		k = sc.nextInt();
		adj = new boolean[n][n];
		for (int i = 0 ; i < n ; ++i) {
			for (int j = 0 ; j < n ; ++j) {
				adj[i][j] = sc.nextInt() == 1;
			}
		}
		double ans = solveUnweighted(n, 0, (1L << n) - 1, 0);
		System.out.println(ans);
	}


	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.IOException;
import java.util.StringTokenizer;
/*
 * @author Tnascimento 
 */

public class MaeDosDragoes {
	public static PrintWriter saida = new PrintWriter(System.out, false);
	public static class Escanear {
        BufferedReader reader;
        StringTokenizer tokenizer;
		public Escanear() {
            this(new InputStreamReader(System.in));
        }
		public Escanear(Reader in) {
            reader = new BufferedReader(in);
        }
        String proximo() {
            if (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return tokenizer.nextToken();
        }
        
        int proximoNum() {
            return Integer.parseInt(proximo());
        }
    }



    public static void main(String[] args) {
		Escanear escanear = new Escanear();
        int proximoInt = escanear.proximoNum();
        double proximoDouble = escanear.proximoNum();
        long[] aux = new long[proximoInt];
        for(Integer i = 0; i < proximoInt; i++) {
            for(Integer j =0; j < proximoInt; j++) {
                Integer val = escanear.proximoNum();
                if (val.equals(1) || i.equals(j)) {
				 aux[i] |= 1L << j;
				}
            }
        }

        int esquerda = proximoInt/2;
        int direita = proximoInt - esquerda;

        int[] depois = new int[1 << esquerda];
        int maiorMascara = 1 << esquerda;

        for(int mascara = 1; mascara <maiorMascara; mascara++) {
            int mascaraAtual = mascara;

            for(int j = 0; j < esquerda; j++) {
                if (((1 << j) & mascara) > 0) {
                    mascaraAtual &= aux[j + direita] >> direita;
                    depois[mascara] = Math.max(depois[mascara], depois[mascara ^ (1 << j)]);
                }
            }
            if (mascara == mascaraAtual) {
                depois[mascara] = Math.max(depois[mascara],Integer.bitCount(mascara));
            }
        }
        int auxiliar = 0;
        int mascaraMaxima = 1 << direita;
        for(int mascara = 0; mascara < mascaraMaxima; mascara++) {
            int mascaraCorrente = mascara;
            int mascaraValor = maiorMascara -1;
            for(int j = 0; j < direita; j++) {
                if (((1 << j) & mascara) > 0) {
                    mascaraCorrente &= (aux[j] & (mascaraMaxima-1));
                    mascaraValor &= aux[j] >> direita;
                }
            }
            if (mascaraCorrente != mascara) continue;
            auxiliar = Math.max(auxiliar, Integer.bitCount(mascara) + depois[mascaraValor]);
        }
        proximoDouble/=auxiliar;
        saida.println(proximoDouble * proximoDouble * (auxiliar * (auxiliar-1))/2);
        saida.flush();
    }
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.IOException;
import java.util.StringTokenizer;
/*
 * @author Tnascimento 
 */

public class MaeDosDragoes {
	public static PrintWriter saida = new PrintWriter(System.out, false);
	public static class Escanear {
        BufferedReader reader;
        StringTokenizer tokenizer;
		public Escanear() {
            this(new InputStreamReader(System.in));
        }
		public Escanear(Reader in) {
            reader = new BufferedReader(in);
        }
        String proximo() {
            if (tokenizer == null || !tokenizer.hasMoreElements()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return tokenizer.nextToken();
        }
        
        int proximoNum() {
            return Integer.parseInt(proximo());
        }
    }
    public static void main(String[] args) {
		Escanear escanear = new Escanear();
		int proximoInt = escanear.proximoNum();
        long[] aux = new long[proximoInt];
        double proximoDouble = escanear.proximoNum();
        for(Integer i = 0; i < proximoInt; i++) {
            for(Integer j =0; j < proximoInt; j++) {
                Integer val = escanear.proximoNum();
                if (val.equals(1) || i.equals(j)) {
				 aux[i] |= 1L << j;
				}
            }
        }
        int esquerda = proximoInt/2;
        int direita = proximoInt - esquerda;
		int maiorMascara = 1 << esquerda;
		int[] depois = new int[1 << esquerda];
		Integer mascara = 1;
		while (mascara < maiorMascara) {
			int mascaraAtual = mascara;
            for(int j = 0; j < esquerda; j++) {
                if (((1 << j) & mascara) > 0) {
                    mascaraAtual &= aux[j + direita] >> direita;
                    depois[mascara] = Math.max(depois[mascara], depois[mascara ^ (1 << j)]);
                }
            }
            if (mascara.equals(mascaraAtual)) {
                depois[mascara] = Math.max(depois[mascara],Integer.bitCount(mascara));
			}
			mascara++;
		}
        int auxiliar = 0;
        int mascaraMaxima = 1 << direita;
        for(int i = 0; i < mascaraMaxima; i++) {
            int mascaraCorrente = i;
            int mascaraValor = maiorMascara -1;
            for(int j = 0; j < direita; j++) {
                if (((1 << j) & i) > 0) {
                    mascaraCorrente &= (aux[j] & (mascaraMaxima-1));
                    mascaraValor &= aux[j] >> direita;
                }
            }
            if (mascaraCorrente != i) continue;
            auxiliar = Math.max(auxiliar, Integer.bitCount(i) + depois[mascaraValor]);
        }
        proximoDouble/=auxiliar;
        saida.println(proximoDouble * proximoDouble * (auxiliar * (auxiliar-1))/2);
        saida.flush();
    }
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.*;
import java.util.*;

public class Solution {

	private static StringTokenizer st;
	private static int n;
	private static int k;

	private static boolean[][] graph;
	private static int[] dp;
	private static int maxCliqueSize;

	public static void main(String[] args) throws Exception {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

		st = new StringTokenizer(reader.readLine());
		n = Integer.parseInt(st.nextToken());
		k = Integer.parseInt(st.nextToken());

		graph = new boolean[n][n];
		dp = new int[1 << (n / 2)];

		for (int i = 0; i < n; ++i) {
			st = new StringTokenizer(reader.readLine());

			for (int j = 0; j < n; ++j)
				graph[i][j] = st.nextToken().equals("1");
		}

		reader.close();

		/* fill dp for first subset */
		int size1 = n / 2;
		int border = 1 << size1;
		for (int mask = 1; mask < border; ++mask) {
			/* check if mask is complete graph */

			boolean isComplete = true;
			for (int i = 0; i < size1; ++i) {
				if (((mask >> i) & 1) == 0)
					continue;

				for (int j = i + 1; j < size1; ++j) {
					if (((mask >> j) & 1) == 0)
						continue;

					if (!graph[i][j]) {
						isComplete = false;
						break;
					}
				}

				if (!isComplete)
					break;
			}

			if (isComplete)
				dp[mask] = Integer.bitCount(mask);
		}

		for (int mask = 1; mask < border; ++mask) {
			for (int i = 0; i < size1; ++i) {
				if (((mask >> i) & 1) == 0) {
					dp[mask | (1 << i)] = Math.max(dp[mask | (1 << i)], dp[mask]);
				}
			}
		}


		/* process second subset */
		maxCliqueSize = 1;
		int size2 = n - n /2;
		border = (1 << size2);

		for (int mask = 0; mask < border; ++mask) {

			boolean isComplete = true;
			for (int i = 0; i < size2; ++i) {
				if (((mask >> i) & 1) == 0)
					continue;

				for (int j = i + 1; j < size2; ++j) {
					if (((mask >> j) & 1) != 0 && !graph[i + size1][j + size1]) {
						isComplete = false;
						break;
					}
				}

				if (!isComplete)
					break;
			}

			if (!isComplete)
				continue;

			int mask1 = (1 << size1) - 1;

			for (int i = 0; i < size2; ++i) {
				if (((mask >> i) & 1) == 0)
					continue;

				for (int j = 0; j < size1; ++j) {
					if (!graph[j][i + size1] && ((mask1 >> j) & 1) != 0)
						mask1 ^= (1 << j);
				}
			}

			maxCliqueSize = Math.max(maxCliqueSize, dp[mask1] + Integer.bitCount(mask));
		}

		// System.out.println(maxCliqueSize);
		double answer = (1.0 * k * k * (maxCliqueSize - 1) / (2 * maxCliqueSize));
		System.out.printf("%.15f", answer);
	}
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.StringTokenizer;

public class MotherOfDragons {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out, false);
        int n = scanner.nextInt();
        double k = scanner.nextInt();
        long[] graph = new long[n];
        for(Integer i = 0; i < n; i++) {
            for(Integer j =0; j < n; j++) {
                Integer val = scanner.nextInt();
                if (val.equals(1) || i.equals(j)) {
				 graph[i] |= 1L << j;
				}
            }
        }

        int szLeft = n/2;
        int szRight = n - szLeft;

        int[] dp = new int[1 << szLeft];
        int maxMask = 1 << szLeft;

        for(int mask = 1; mask <maxMask; mask++) {
            int curMask = mask;

            for(int j = 0; j < szLeft; j++) {
                if (((1 << j) & mask) > 0) {
                    curMask &= graph[j + szRight] >> szRight;
                    dp[mask] = Math.max(dp[mask], dp[mask ^ (1 << j)]);
                }
            }
            if (mask == curMask) {
                dp[mask] = Math.max(dp[mask],Integer.bitCount(mask));
            }
        }
        int ans = 0;
        int rmaxMask = 1 << szRight;
        for(int mask = 0; mask < rmaxMask; mask++) {
            int curMask = mask;
            int oMask = maxMask -1;
            for(int j = 0; j < szRight; j++) {
                if (((1 << j) & mask) > 0) {
                    curMask &= (graph[j] & (rmaxMask-1));
                    oMask &= graph[j] >> szRight;
                }
            }
            if (curMask != mask) continue;
            ans = Math.max(ans, Integer.bitCount(mask) + dp[oMask]);
        }
        k/=ans;
        out.println(k * k * (ans * (ans-1))/2);
        out.flush();
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }

        public FastScanner() {
            this(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}
// Problem: 839_E. Mother of Dragons
// Time complexity: np
import java.io.*;
import java.util.*;

public class E {

	
	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		int n=sc.nextInt(),k=sc.nextInt();
		boolean [][]adj=new boolean[n][n];
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++)
				adj[i][j]=sc.nextInt()==1;
		int n1=n/2,n2=n-n1;
		int []clique=new int [1<<n1];
		for(int msk=1;msk<1<<n1;msk++)
		{
			boolean ok=true;
			for(int i=0;i<n1;i++) if((msk & 1<<i) !=0)
				for(int j=i+1;j<n1;j++)
					if((msk & 1<<j) !=0 && !adj[i][j])
						ok=false;
			if(ok)
				clique[msk]=Integer.bitCount(msk);
		}
		
		int []edges=new int [n2];
		for(int i=0;i<n2;i++)
		{
			int msk=0;
			for(int j=0;j<n1;j++)
				if(adj[i+n1][j])
					msk|=1<<j;
			edges[i]=msk;
		}
		int max=0;
		for(int msk=1;msk<1<<n1;msk++)
			for(int i=0;i<n1;i++)
				if((msk & 1<<i) !=0)
					max=Math.max(max, clique[msk]=Math.max(clique[msk], clique[msk^(1<<i)]));
		
		for(int msk=1;msk<1<<n2;msk++)
		{
			int all=(1<<n1)-1;
			for(int j=0;j<n2;j++)
				if((msk & 1<<j) !=0)
					all &=edges[j];
			boolean ok=true;
			for(int i=0;i<n2;i++) if((msk & 1<<i) !=0)
				for(int j=i+1;j<n2;j++)
					if((msk & 1<<j) !=0 && !adj[i+n1][j+n1])
						ok=false;
			if(ok)
				max=Math.max(max, Integer.bitCount(msk)+clique[all]);	
			
			
		}
		
		out.printf("%.9f\n",k*1.0*k*(max-1)/(2*max));
		
		out.close();
		
		
	}
	static class Scanner {
        StringTokenizer st;
        BufferedReader br;
 
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }
 
        public Scanner(FileReader s) {
            br = new BufferedReader(s);
        }
 
        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }
 
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
 
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
 
        public String nextLine() throws IOException {
            return br.readLine();
        }
        public boolean ready() throws IOException {return br.ready();}
        public double nextDouble() throws IOException {return Double.parseDouble(next());}
       
    }
}