Submit | All submissions | Best solutions | Back to list |
POLYSSQ - Polygon |
You are given N different points in the plane. No three of them are collinear. Write a program that finds out the smallest area of a convex polygon with K vertices which are taken from the given points.
Input
Two integers, N and K, are written on the first line in the standard input. It follows N lines, each containing a pair of coordinates for the corresponding given point. Every two numbers on a line in the input are separated by a space. Constraints: 0 < N < 50, 0 < K < 11. The coordinates of the given points are nonnegative integers, less than 9999.
Output
Your program has to output an integer that is equal to the integer part of minimal area. If there does not exist any convex polygon as is described above, your program has to output 0.
Example
Input: 4 3 0 0 1 1 0 10 10 0 Output: 5
Added by: | Chinh Nguyen |
Date: | 2008-04-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | Bulgarian OI |