forked from volzkzg/sgu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path151.cpp
45 lines (41 loc) · 955 Bytes
/
151.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
using namespace std;
double a,b,c,m,x,y;
int main(){
freopen("test.in","r",stdin);
freopen("test.out","w",stdout);
scanf("%lf %lf %lf\n",&c,&b,&m);
if ((a = c*c+b*b-2*m*m) >= 0){
a = sqrt(fabs(a)/2)*2;
x = (b*b+c*c-a*a)/(2*c);
y = sqrt(fabs(b*b-x*x));
printf("%.5lf %.5lf\n",0,0);
printf("%.5lf %.5lf\n",c,0);
printf("%.5lf %.5lf\n",x,y);
}else
printf("Mission impossible\n");
}
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
double c,b,m,x,y;
scanf("%lf%lf%lf",&c,&b,&m);
if (2*m<fabs(c-b) || 2*m>c+b)
printf("Mission impossible\n");
else
{
x=(4*m*m-c*c-b*b)/c/2;
y=b*b-x*x>=0?sqrt(b*b-x*x):0;
printf("%.5lf %.5lf\n%.5lf %.5lf\n%.5lf %.5lf\n",0.0,0.0,c,0.0,x,y);
}
return 0;
}