Thursday, July 30, 2015

1305 - Area of a Parallelogram

#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int T,Ax,Ay,Bx,By,Cx,Cy,c=1,r;
//    freopen("check.txt","r",stdin);
    scanf("%d",&T);
 
    while(T--)
    {
        scanf("%d%d%d%d%d%d",&Ax,&Ay,&Bx,&By,&Cx,&Cy);
        r = (Ax*(By-Cy)+Ay*(Cx-Bx)+(Bx*Cy-Cx*By));
        if(r<0)
            r *= -1;
        printf("Case %d: %d %d %d\n",c++,(Ax+Cx-Bx),(Ay+Cy-By),r);
    }
    return 0;
}

1 comment:

  1. Hard Rock Hotel and Casino Lake Tahoe - Mapyro
    Hard Rock 계룡 출장안마 Hotel and Casino 강릉 출장샵 Lake Tahoe 춘천 출장샵 - Find out 강릉 출장안마 the timings, photos, directions and a map 안성 출장샵 of Hard Rock Hotel and Casino Lake Tahoe,

    ReplyDelete

Triathlon

Triathlon - CodeChef # include < bits/stdc++.h > using namespace std ; # define fi first # define se second # define mp ...