SCUT Training 20170920 Problem K

来源:互联网 发布:12345网络举报平台 编辑:程序博客网 时间:2024/06/05 08:09

原题:http://codeforces.com/gym/101409/problem/A

Problem A


思路:

看懂就秒杀了


源代码:

#include <iostream> //K#include <cstdio>#include <iomanip>using namespace std;double a,b,c,d=0;int test,n=0;double maxx,tmp=0;int main(){    freopen("area.in","r",stdin);    freopen("area.out","w",stdout);    maxx=0;    scanf("%d",&n);    for (int i=1;i<=n;i++)    {        scanf("%lf%lf%lf%lf",&a,&b,&c,&d);        tmp=(c-a)*(b-d)/(2*(c-a+b-d));        if (tmp>maxx) maxx=tmp;    }    cout.unsetf(ios::showpoint);    cout<<maxx<<endl;    fclose(stdin);    fclose(stdout);    return 0;}

原创粉丝点击