This page is still under construction.

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

Pineapple Pizza

Time limit1sMemory limit256 MB

Summary
Given n points and a center Q, decide whether k rays from Q can split the plane so every sector holds exactly n/k points, with no point on a ray.
Level

Hard8 of 10

Topics
Geometry, Sorting, Binary search, Two pointers
Solved
No attempts yet

Problem

There is a very large pineapple pizza. It is so large that it is treated as an infinite two-dimensional plane. The pizza has nn pineapple pieces, written as points P1,P2,…,PnP_1, P_2, \dots, P_n. Each piece counts as a point with no area. A point QQ and a number kk of people are given. Draw kk rays that start at QQ and split the pizza into kk parts. Every part must hold the same number of pineapple pieces. No pineapple piece may lie on a border line. Write a program that decides whether such kk rays exist.

Input

The first line gives nn and kk (2≤n,k≤80002 \le n, k \le 8000). The next nn lines give the coordinates of the points PP. Line i+1i + 1 gives the xx and yy coordinates of PiP_i. Line n+2n + 2 gives the xx and yy coordinates of QQ. All points PP and the point QQ are pairwise distinct. Every coordinate is an integer from −105-10^5 to 10510^5.

Output

Print YES when such rays exist, and NO otherwise.

Hint

See the figure below.

Examples1

  1. Example 1

    Input
    6 3
    -2 0
    1 1
    3 3
    -4 -4
    -2 4
    4 -2
    0 0
    
    Expected output
    YES