Cake 3
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Grammy bought a big cake. She wants to put n candles on the cake to form a pretty pattern and share the cake with her friends. Each candle can be viewed as a point on the plane. The distance between two candles is considered as the Euclidean distance on the plane. Two candles cannot be placed at the same point.

For each (unordered) pair of candles (u,v), if u is one of the nearest candles of v, and v is one of the nearest candles of u, then (u,v) is called a good pair.

Grammy wants to choose the positions for all candles such that each candle is in exactly k good pairs. Please help Grammy to find a set of positions for the candles or report if no solutions exist.

输入描述:

The only line contains 2 integers n,k (2\leq n \leq 1000, 1 \leq k \leq n-1), denoting the number of candles and the integer chosen by Grammy.

输出描述:

If the solution does not exist, output "\texttt{NO}" on a single line.

Otherwise, output "\texttt{YES}" on the first line, then output n lines, each of which contains two real numbers x_i,y_i (-10^6 \leq x_i,y_i \leq 10^6), denoting the position of a candle. If there are multiple solutions, output any.

The distance between two candles will be calculated using double-precision floating point numbers with a tolerance of 10^{-6}. That is, if the nearest candle to a candle u has a distance of a, then all candles having a distance less than or equal to a\cdot (1+10^{-6}) to candle u are considered as nearest candles of u. Additionally, two candles having a distance less than or equal to 10^{-6} are considered as two candles at the same position, which should not appear in your output.

示例1

输入

复制
4 1

输出

复制
YES
0.000000000000 0.000000000000
0.000000000000 1.000000000000
2.000000000000 0.000000000000
2.000000000000 1.000000000000
示例2

输入

复制
4 2

输出

复制
YES
0.707106781187 0.000000000000
0.000000000000 0.707106781187
-0.707106781187 0.000000000000
-0.000000000000 -0.707106781187
示例3

输入

复制
4 3

输出

复制
NO