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.

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.