Skip to content

Instantly share code, notes, and snippets.

@PreSoichiSumi
Created April 26, 2016 08:05
Show Gist options
  • Save PreSoichiSumi/34cdf70029c40acb3fdda925475414a0 to your computer and use it in GitHub Desktop.
Save PreSoichiSumi/34cdf70029c40acb3fdda925475414a0 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static int[][] maze =new int [100][];
public static int[][] dist =new int [100][];
public static int[][] dir ={{-1,0},{1,0},{0,-1},{0,1}};
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double N=sc.nextDouble();
double K=sc.nextDouble();
System.out.println((1+3*(N-K)+3*(K-1)+6*(K-1)*(N-K))/(N*N*N));
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment