题目大意+分析均见:
http://46aae4d1e2371e4aa769798941cef698.devproxy.yunshipei.com/qq_21995319/article/details/45749873
其实就是一道解方程的题目…
AC code:
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#define pb push_back
#define mp make_pair
#define ONLINE_JUDGE
typedef long long LL;
typedef double DB;
typedef long double LD;
using namespace std;
DB sqr(DB x) {return x*x;}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int h, Bisector, Median;
scanf("%d%d%d", &h, &Bisector, &Median);
if(h == Bisector && Bisector == Median)
{
puts("YES");
printf("0 %d\n", h);
printf("1 0\n-1 0\n");
}
else if(h < Bisector && Bisector < Median)
{
puts("YES");
DB a, b, x;
a = sqrt(sqr((DB)Median)-sqr((DB)h));
b = a-sqrt(sqr((DB)Bisector)-sqr((DB)h));
x = sqrt(a*b+b*sqr(h)/(a-b));
printf("0 %d\n", h);
printf("%.20lf 0\n", x+a);
printf("%.20lf 0\n", a-x);
}
else puts("NO");
#ifndef ONLINE_JUDGE
fclose(stdin);
fclose(stdout);
#endif
return 0;
}