标签:
化成反比函数求积分
Time Limit: 1 sec
Memory Limit: 16MB
Consider rectangular coordinate system and point L(X,Y) which is randomly chosen among all points in the area A which is defined in the following manner: A = {(x,y) | x is from interval [-a;a]; y is from interval [-b;b]}. What is the probability P that the area of a rectangle that is defined by points (0,0) and (X,Y) will be greater than S?
%" symbol following that number on a single line. P must be rounded to 6 digits after decimal point.
3 10 5 20 1 1 1 2 2 0
23.348371%
0.000000%
100.000000%
Problem setters: Aleksej Viktorchik, Leonid Shishlo.
Huge Easy Contest #1
/* ***********************************************
Author :CKboss
Created Time :2015年01月29日 星期四 22时10分37秒
File Name :UVA11346.cpp
************************************************ */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
double a,b,s;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int T_T;
scanf("%d",&T_T);
while(T_T--)
{
scanf("%lf%lf%lf",&a,&b,&s);
if(s==0)
{
printf("100.000000%\n");
continue;
}
else if(a*b<=s)
{
printf("0.000000%\n");
continue;
}
double area = log(b)-log(s/a);
double mu = 4*a*b;
area = s + s*area;
area*=4;
printf("%.6lf%\n",100.*(1.-area/mu));
}
return 0;
}
标签:
原文地址:http://blog.csdn.net/ck_boss/article/details/43281927