public class Radiation_Shape1
{
public static double F(double r,double h)
{
int total_ray=0;
int N=1000000;
double teta=Math.atan(h/(2*r));
double tetamax=Math.PI/2;
double teta1=0;
for(int i=0;i<N;i++)
{teta1=tetamax*Math.random();
 if(teta1<=teta) total_ray++;
}
return (double)total_ray/(double)N; 
}
public static void main(String arg[])
{
double r=1;
double h=1;
System.out.println("F="+F(r,h));
}

}