QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 32 MB Total points: 10

#11042. Potato [B]

统计

Marcin is peeling a potato. For simplicity, we assume that the potato is a convex polygon^{1}, which edge is called a rind.

Marcin can perform straight cuts with his knife. With each cut, Marcin selects some straight line, along which a cut is being performed. After a cut is done, he throws away one of the parts of the potato. All points along the cut-line are also thrown away, so for instance when cutting along the line containing some edge belonging to the rind of the potato, that edge gets peeled.

A potato is said to be peeled only when it does not contain any point of the original rind. Marcin wants to perform as little work as possible when peeling the potato, which is why he would like to peel it with a limited number of cuts. Nevertheless, he wants to maximize the size of the peeled potato. What is the largest area of the pealed potato that can be obtained with at most $ k $ cuts?

Write a program which:

  • reads a description of the potato from the standard input,
  • determines the largest possible area of the peeled potato assuming that at most $ k $ cuts can be performed,
  • writes the result to the standard output.

^{1}Convex polygon is a polygon with all inner angles smaller than 180°.

Input Format

In the first line of the standard input there are two integers $ n $ (3 ≤ $ n $ ≤ 100) and $ k $ (3 ≤ $ k $ ≤ $ n $), separated by a single space and denoting the number of vertices of the polygon representing a potato under consideration and the maximal number of cuts that Marcin wants to perform to peel the potato. The following $ n $ lines contain a description of the following vertices of the potato. They are specified in clockwise or anti-clockwise order. Each line contains two integers $ x $ and $ y $, -10 000 ≤ $ x $, $ y $ ≤ 10 000, representing coordinates of the following potato's vertex.

Output Format

In the first and only line of the standard output your program should write one real number, written with exactly one digit after the dot and representing the largest possible area of the peeled potato that can be obtained with at most $ k $ cuts. You should not round this number, the second and following digits after the dot do not impact the outcome.

Example

Input

5 3
0 0
3 1
6 4
3 7
0 8

Output

24.0
problem_11042_1.gif

Sample potato can be optimally peeled with 3 cuts in the way demonstrated above.

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.