This page is still under construction.

Parts of this page are still being built. What you see may change.

Karelian Fortune Telling

Time limit1sMemory limit1024 MB

Summary
Count convex K-gons with vertices chosen from N points in general position, answering several values of K.
Level

Medium7 of 10

Topics
Combinatorics, Geometry, Dynamic programming, Sorting
Solved
No attempts yet

Problem

Yukka loves to tell fortunes from the stars, but the sky is often cloudy, so a map of the starry sky is used instead. The map shows NN stars. To tell a fortune, one must choose KK of the stars, and if the polygon whose vertices are these points is convex, the fortune telling is considered successful. A polygon is convex if, for the line passing through each of its sides, all of its vertices lie on one side of that line or on the line itself.

Pekka, watching Yukka tell fortunes, wanted to know how many different convex KK-gons can be built by choosing their vertices from the given points.

Your task is to answer this question for several possible values of KK.

Input

The first line of the input contains two numbers: the number of points NN and the number of cases to consider LL (3≤N≤303 \le N \le 30, 1≤L≤N−21 \le L \le N-2). The next NN lines contain two integers XiX_i, YiY_i each: the coordinates of the points (−10 000≤Xi,Yi≤10 000-10\,000 \le X_i, Y_i \le 10\,000). No three points lie on one line, and no two points coincide.

You must count the number of convex polygons for LL different values of KK, listed in the last line. All LL numbers are positive integers, each at least three and at most NN.

Output

In the first line, output LL numbers separated by spaces: the answers for each case.

Examples1

  1. Example 1

    Input
    5 3
    0 0
    4 4
    0 4
    4 0
    2 3
    3 4 5
    
    Expected output
    10 3 0