三分
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
# <20><>Ŀ
|
# <20><>Ŀ
|
||||||
* <20><><EFBFBD><EFBFBD>
|
* <20><><EFBFBD><EFBFBD>
|
||||||
### <20><><EFBFBD><EFBFBD>
|
### <20><><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>L
|
||||||
|

|
||||||
### <20><><EFBFBD><EFBFBD>
|
### <20><><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
mid=(l+r)/2;
|
||||||
|
midr(mid+r)/2;
|
||||||
|
Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
### <20>ؼ<EFBFBD><D8BC><EFBFBD>
|
### <20>ؼ<EFBFBD><D8BC><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
### <20>״<EFBFBD><D7B4><EFBFBD>
|
### <20>״<EFBFBD><D7B4><EFBFBD>
|
||||||
*
|
* <20><>ʼλ<CABC><CEBB>
|
||||||
### <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
### <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
*
|
*
|
BIN
8.21/B-Light/look
Normal file
BIN
8.21/B-Light/look
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@@ -3,29 +3,33 @@
|
|||||||
#include<algorithm>
|
#include<algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
//const int N=1e8+5;
|
const double eps= 1e-5;
|
||||||
//void initialise(int n)
|
double H,h,D;
|
||||||
//{
|
double f(double d)
|
||||||
//
|
{
|
||||||
//}
|
return D-d+H-(H-h)*D/d;
|
||||||
|
// return D-d+h-(H-h)*(D-d)/d;
|
||||||
|
}
|
||||||
|
double sanfen(double l,double r)
|
||||||
|
{
|
||||||
|
double mid,midr,ans;
|
||||||
|
while(fabs(r-l)>eps)
|
||||||
|
{
|
||||||
|
mid=(l+r)/2;
|
||||||
|
midr=(mid+r)/2;
|
||||||
|
if(f(mid)<f(midr))l=mid;
|
||||||
|
else r=midr;
|
||||||
|
}
|
||||||
|
return f(l);
|
||||||
|
}
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
double H,h,D;
|
|
||||||
scanf("%d",&t);
|
scanf("%d",&t);
|
||||||
while(t--)
|
while(t--)
|
||||||
{
|
{
|
||||||
scanf("%lf%lf%lf",&H,&h,&D);
|
scanf("%lf%lf%lf",&H,&h,&D);
|
||||||
// initialise(n);
|
printf("%.3lf\n",sanfen(D-D*h/H,D));
|
||||||
double add=D/2-(H-h);
|
|
||||||
if(add>0)
|
|
||||||
{
|
|
||||||
printf("%.3lf\n",h+add);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("%.3lf\n",h);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
1
8.21/B-Light/tempCodeRunnerFile.cpp
Normal file
1
8.21/B-Light/tempCodeRunnerFile.cpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
D
|
BIN
8.21/E-typewriter/E.pdf
(Stored with Git LFS)
Normal file
BIN
8.21/E-typewriter/E.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user