Probability UVA - 11346

版权声明:如有错误,请指出,不胜感激。 https://blog.csdn.net/qq_36424540/article/details/79974954
#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;

const int maxn=2e5+10;
const double eps=1e-3;

int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		double a,b,s;
		scanf("%lf %lf %lf",&a,&b,&s);
		double ans=0.0;
		if(s-a*b>=eps)
			printf("%.6f%%\n",ans);
		else{
			ans=1.0-(s*(1+log(a*b/s)))/(a*b);
			if(fabs(s)<eps&&fabs(a*b)>eps)ans=1.0;
			printf("%.6f%%\n",ans*100); 
		}
	}
	return 0;
}

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页