原题: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; }