2656Paint Joy

2656   Paint Joy

题目描述

Lisa had just learned how to use ruler and compasses, she was so excited and she paint many strange graph. Just like this picture.

QQ图片20151031130442

In these graph, some side are straight line and others are arc with known center. Now she want to know the area of the graph. Can you help this cute Lolita?

输入格式:

There is a T at the beginning of file, show that there is T case follow.

For each case, first line is an integer n, means there is n dot in the graph.(The number of dot is from 1 to n)

Next n line, each line contain an integer k.

If k=1, then it followed by 2 integer a,b, means dot i is at point(a,b),and dot i link dot (i+1) with a straight line.

Else if k=0 ,then it followed by 4 integer a,b,c,d, means dot i is at point(a,b), and dot i link dot (i+1) with an arc, and the center of the circle is at (c,d).

PS1: For the dot n ,the dot (n+1) means the dot 1.

PS2: All the arc is less than 180

PS3: 3<=n<=15, 0<=a,b,c,d<=1000

PS4: There is no coincide point and no intersection of any to edge.

输出格式:

For every case, first output"Case #x: ",x mean the number of case.

Then output one number, means the answer,round to 0 digit.

  See sample for detail.

输入样例 复制
1
3
1 1 0
1 0 0
0 0 1 0 0
输出样例 复制
Case #1: 1

说明

1
1
通过提交
时空限制1000ms/32mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度