hdu 5243 Homework

Homework

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 413    Accepted Submission(s): 48

Problem Description

As this term is going to end, DRD needs to start his graphical homework.

In his homework, DRD needs to partition a point set S into two part. You can see that if one part has 100 points and the other has only 1 point, then this partition cannot be beautiful since it‘s too imbalanced. DRD wants to find a line to separate S, so that no points lie in the line and there are at least ⌊|S|3⌋ points in each side of the line. DRD finds it amazing that there may exist some points (no need to be in S) that if a line l passes it and does not pass any points in S, then l can be a separating line. Now, he wonders the area these points form.

Input

First line: a positive integer T≤10 indicating the number of test cases.
There are T cases following. In each case, the first line contains an positive integer n≤1000, and n lines follow. In each of these lines, there are 2 integers xi,yiindicating a point (xi,yi) in the plane. Note that |xi|,|yi|≤104
You can assume that no three points in S lies in the same line.

Output

For each test case: output ‘‘Case #x: ans‘‘ (without quotes), where x is the number of the cases, and ans is the area these points form.
Your answer is considered correct if and only if the absolute error or the relative error is smaller than 10−6.

Sample Input

2
4
1 1
1 -1
-1 -1
-1 1
8
-1 -1
-1 1
1 -1
1 1
-2 -2
-2 2
2 -2
2 2

Sample Output

Case #1: 4.000000
Case #2: 5.333333

Source

时间: 2024-07-28 12:42:53

hdu 5243 Homework的相关文章

上海邀请赛 补题中

比赛的时候就出了5题,赛后发现其实很多题可以写,不知道为啥赛时这么逗比加坑队友,过两天做个总结 5236 Article 29.45%(134/455) 5237 Base64 41.67%(175/420)   5238 Calculator 43.85%(82/187) 5239 Doom 23.67%(138/583) 5240 Exam 50.61%(249/492) 5241 Friends 48.86%(215/440) 5242 Game 29.91%(195/652) 5243

[2016-03-28][HDU][1074][Doing Homework]

时间:2016-03-28 18:46:36 星期一 题目编号:[2016-03-28][HDU][1074][Doing Homework] 题目大意:给定n门科作业的期限时间和完成耗时,每科每超过一天就扣一份,求最少扣分数 分析:n只有15,二进制枚举,状态压缩,枚举每种科目完成的状态,更新下一个状态,求最小值 #include <cstring> #include <cstdio> using namespace std; const int maxstu = 1 <&

hdu 5298 Solid Geometry Homework(几何)

题目链接:hdu 5298 Solid Geometry Homework 每个圈或者是平面将划分出两个区域,每次把一边区域取反即可.最后判断一下是否满足. #include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; const int maxn = 3000; typedef long long ll; struct Poi

HDU 1074:Doing Homework(状压DP)

http://acm.hdu.edu.cn/showproblem.php?pid=1074 Doing Homework Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7704    Accepted Submission(s): 3484 Problem Description Ignatius has just come bac

HDU 1074 Doing Homework(状压DP)

Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after the deadline, the teacher will r

hdu 1789 Doing HomeWork Again (贪心算法)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 /*Doing Homework again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7903 Accepted Submission(s): 4680 Problem Description Ignatius has just c

HDU 1789 - Doing Homework again - [贪心+优先队列]

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Eve

【题解】HDU Homework(倍增)

[题解]HDU Homework(倍增) 矩阵题一定要多多检查一下是否行列反了... 一百个递推项一定要存101个 说多了都是泪啊 一下午就做了这一道题因为实在是太菜了太久没写这种矩阵的题目... 设一个行向量\(e\),和一个增逛矩阵\(A\),他们咋定义的见我那篇讲线性递推博客 现在我们再预处理\(st\)矩阵数组,其中\(st_i=A^{2^i}\). 考虑这样一种做法,我们考虑让\(e\)总共有101个值,然后当第一个值被增逛为\(f_{q.n-100}\)时,暴力将\(e\)中的第\(

【hdu 1789】 Doing Homework again

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do.