EN
Sarma

2023 · Task 1

Sarma

Author: Ivan Milinović

30/11/2023 00:01 – 20/12/2023 23:59

Ivan has finally got his Christmas sarma (cabbage rolls), and this year he talked his mum into making loads of them! Once everyone had gone to bed, he crept into the kitchen, grabbed a ladle and started piling sarma onto his plate, but he soon realised that at this rate he would never get them all. Ivan wants to move all the sarma onto his plate in as few scoops as possible, but since he doesn't know the optimal way to do it, he has asked for your help.

More formally, the pot holding the sarma can be represented by a Cartesian coordinate system, and each sarma by a rectangle whose vertices are integer points. The ladle is represented by a circle of radius R. With each scoop, Ivan places the ladle at some real coordinates and scoops up every sarma that the ladle's area touches. Your goal is to find the minimum number of scoops such that all the sarma end up on Ivan's plate.

Input

The first line contains N and R - the number of sarma in the pot (1 ≤ N ≤ 105) and the radius of the ladle (1 ≤ R ≤ 109).
Each of the next N lines contains 4 numbers: the lower-left and upper-right corners of the i-th sarma (rectangle) (-109 ≤ Xi1, Yi1, Xi2, Yi2 ≤ 109).

Output

The first line contains K (1 ≤ K ≤ 105) - the total number of scoops.
Each of the next K lines contains two real numbers Xi and Yi (-109 ≤ Xi, Yi ≤ 109), the coordinates of the centre of the ladle for the i-th scoop, rounded to at most 6 decimal places.

Scoring

Your score is calculated as 105 - K. If your solution gets WA (you did not scoop up all the sarma), you get 0 points.

Example

Input

2 2
1 0 2 2
3 3 4 4

Output

1
1.5 3

GeoGebra illustration of the example

Solution

You can try out and test solutions by hand here (instructions are included - README.md).