import java.text.*; import java.util.*; class Combat { public static void main(String[] args) { int athp = Integer.parseInt(args[0]); int atfp = Integer.parseInt(args[1]); int dfhp = Integer.parseInt(args[2]); int dffp = Integer.parseInt(args[3]); int attwins = (dfhp*10)/atfp; if ((dfhp*10)%atfp != 0) attwins++; int defwins = (athp*10)/dffp; if ((athp*10)%dffp != 0) defwins++; int minrounds = attwins; int maxrounds = attwins+defwins-1; int[][] choose = new int[maxrounds][]; for(int i=0; i= att) p= ((double)(att-1)) / (double)(2*def); else p= 1.0d - (((double)(def+1)) / (double)(2*att)); double q = 1.0-p; for(int r=minrounds; r<=maxrounds; r++) { double t =(double)choose[r-1][attwins-1]; int numdfwins = r-attwins; for(int j=0; j= att) p= ((double)(att-1)) / (double)(2*def); else p= 1.0d - (((double)(def+1)) / (double)(2*att)); double q = 1.0-p; for(int r=minrounds; r<=maxrounds; r++) { double t =(double)choose[r-1][attwins-1]; int numdfwins = r-attwins; for(int j=0; j