UVA11346Probability

//UVA11346Probability
#include<cstdio>
#include<cstring>
#include<cmath>
int main() {
    int N;
	double a, b, s;
	scanf("%d", &N);
	while(N--)  {
		scanf("%lf%lf%lf", &a, &b, &s);
		if(s >= a * b - 1e-5) {
			printf("%.6lf%%\n", 0.0); continue;
		} 
		if(s <= 1e-5) {
			printf("%.6lf%%\n", 100.0); continue;
		}
		long double sum = (long double)s + s * (log(a * b / s));
		sum /= a * b;
		double ans = (1 - sum) * 100;
		printf("%.6lf%%\n", ans);
	}	
	return 0;
}
/*
3
10 5 20
1 1 1
2 2 0
*/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章