杭电acm1071

#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{   int t;
    double x1,y1,x2,y2,x3,y3,a,k,s;
    cin>>t;
    while(t--)
    { cin>>x1>>y1>>x2>>y2>>x3>>y3;
      a=(y2-y1)/((x2-x1)*(x2-x1));
      k=(y2-y3)/(x2-x3);
      s=a/3*(x3*x3*x3-x2*x2*x2)+(a*x1*x1+k*x3+y1-y3)*(x3-x2)+0.5*(2*a*x1+k)*(x2*x2-x3*x3);
       printf("%.2f\n",s);
    }
return 0;
}

posted @ 2015-11-14 13:35  StevenLuke  阅读(122)  评论(0编辑  收藏  举报