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
 
 
 
 

hdu 5243 Homework的更多相关文章

  1. HDU——1789Doing Homework again(贪心)

    Doing Homework again Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...

  2. 动态规划: HDU 1789Doing Homework again

    Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of h ...

  3. HDU 1789 Doing Homework again (贪心)

    Doing Homework again http://acm.hdu.edu.cn/showproblem.php?pid=1789 Problem Description Ignatius has ...

  4. HDU 1074 Doing Homework (dp+状态压缩)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1074 题目大意:学生要完成各科作业, 给出各科老师给出交作业的期限和学生完成该科所需时间, 如果逾期一 ...

  5. 【状态DP】 HDU 1074 Doing Homework

    原题直通车:HDU  1074  Doing Homework 题意:有n门功课需要完成,每一门功课都有时间期限t.完成需要的时间d,如果完成的时间走出时间限制,就会被减 (d-t)个学分.问:按怎样 ...

  6. HDU 1074 Doing Homework (动态规划,位运算)

    HDU 1074 Doing Homework (动态规划,位运算) Description Ignatius has just come back school from the 30th ACM/ ...

  7. hdu 1789 Doing HomeWork Again (贪心算法)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 /*Doing Homework again Time Limit: 1000/1000 MS ...

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

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1789 Time Limit: 1000/1000 MS (Java/Others) Memory Li ...

  9. HDU 5298 Solid Geometry Homework 暴力

    Solid Geometry Homework 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5298 Description Yellowstar ...

随机推荐

  1. servle 3.0 新特性之一 对上传表单的支持

    1. 上传 * 上传对表单的要求: > method="post" > enctype="multipart/form-data",它的默认值是:a ...

  2. Python通过fork的方式防止僵尸进程

    import subprocess import os import sys import platform def fock_new(func): def inner(*args, **kwargs ...

  3. phonegap file api

    https://github.com/chrisben/imgcache.js/tree/master/examples 1.FILE API file api最大的两个功能是download和upl ...

  4. 剑指offer 面试58题

    面试58题: 题目:翻转字符串 题:牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上.同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意 ...

  5. 备注字段长度控制JS

    //变更原因备注字符长度控制 function checkChangeLength() { var field = $("#changeReasonDesc").val(); ma ...

  6. Python进阶(2)_进程与线程的概念

    1 进程与线程相关概念 1.1 进程 进程定义: 进程就是一个程序在一个数据集上的一次动态执行过程.进程一般由程序.数据集.进程控制块三部分组成,是最小的资源管理单元 程序:用来描述进程要完成哪些功能 ...

  7. 【转】通过fio工具,测试SATA,SAS,SSD 读写性能

      转自:http://blog.csdn.net/killmice/article/details/42745937

  8. Ubuntu中输入输出重定向及管道技术简述

    输出 1.标准输出 定义:程序在默认情况下输出结果的地方(stdout). 2.输出重定向 定义:用于把数据的输出转移到另一个地方去. 3.Ubuntu中例子 $ls > ~/ls_out  # ...

  9. 跨平台移动开发 Xuijs超轻量级的框架 Dom与Event简洁代码实现文本展开收起

    Dom与Event简洁代码实现文本展开收起 Xuijs超轻量级的框架 Dom与Event实现文本展开收起 效果图 示例代码 <!DOCTYPE html PUBLIC "-//W3C/ ...

  10. 20145230《java学习笔记》第七周学习总结

    20145230 <Java程序设计>第7周学习总结 教材学习内容 Lambda语法概览 我们在许多地方都会有按字符串长度排序的需求,如果在同一个方法内,我们可以使用一个byName局部变 ...