pa,qa=STDIN.gets.split(" ") pa=pa.to_f qa=qa.to_f p1=(1-pa)*qa p2=pa*(1-qa)*qa if p1