G - Preparing for Exams

题目链接:

https://vjudge.net/contest/251958#problem/G

具体思路:

圆内四边形内角互补,所以,如图所示。

证明,三角形oda和三角形obc相似。

第一步,角o都相等

第二步,证明角oda等于角obc。(角oda+角adc=180.角adc+角abc等于180(圆的性质,对顶角相加等于180,),所以,得证),

代码链接:

#include<iostream>
#include<string>
#include<cstring>
#include<iomanip>
#include<queue>
#include<stack>
#include<map>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<cmath>
using namespace std;
# define maxn 700000+10
# define ll long long
# define inf 0x3f3f3f3f
char s[maxn];
int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        double a,b,c,d;
        scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
        double temp=sqrt(c)/sqrt(d);
        double x=(b-a*temp)/temp;
        double y=(a-b*temp)/temp;
        printf("%lf %lf\n",y,x);
    }
    return 0;
}

 

posted @ 2018-09-05 15:13  Let_Life_Stop  阅读(117)  评论(0编辑  收藏  举报