# 2019-2020 Azerbaijan Finals, June 17

# Skyscrapers

**5000** years later, when the coronavirus epidemic was stopped, **n** skyscrapers are planned to be built in Baku. We will represent Baku as the coordinate axis of numbers. For each skyscraper, its coordinate (`x`

) and height (_{i}`h`

) are given. Engineers consider the skyscraper "_{i}**unprofitable**" if to the left of it at a distance of no more than **d**, and also to the right of it at a distance of no more than **d**, there is a skyscraper which height is at least twice more than the height of a given skyscraper (this skyscraper itself may be **unprofitable**). Such skyscrapers are considered unsuccessful from a business point of view, so engineers plan to build some other facility instead. You must calculate the number of "**unprofitable**" skyscrapers so that the engineers know their job.

#### Input

First line contains two numbers **n** (**1** ≤ **n** ≤ `10`

) and ^{5}**d** (`1`

≤ **d** ≤ `10`

). Next ^{9}**d** lines contain integers `x`

and _{i}`h`

(_{i}**1** ≤ `x`

, _{i}`h`

≤ _{i}`10`

). All coordinates of skyscrapers are different.^{9}

#### Output

Print the number of **unprofitable** skyscrapers.

6 4 10 3 6 2 5 3 9 7 3 6 11 2

2