#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Peanut is organising a talk today with a group of *N* people. The stage is *M* meters wide and the *N* people are seated in a line, each of them *D _{i}* meters from the leftmost edge of the stage. Peanut wants to place some speakers along the line so that everyone can hear his speech. However, some people have hearing loss. Thus, each person

*i*requires them to be at most

*R*away from a speaker. Help Peanut determine what is the minimum number of speakers he needs to place such that everyone can hear his speech.

_{i}## Limits

Subtask 1 (14%): 1 ≤ N, M ≤ 15.Subtask 2 (16%): 1 ≤ N, M ≤ 1 000.

Subtask 3 (21%): 1 ≤ N, M ≤ 100 000.

Subtask 4 (49%): 1 ≤ N ≤ 100 000. 1 ≤ M ≤ 1 000 000 000.

Subtask 5 (0%): Sample testcase.

## Input

The first line of input contains two integers,*N*and

*M*.

The next

*N*lines of input contains two integers each,

*D*and

_{i}*R*.

_{i}## Output

The output should contain one integer, the minimum number of speakers required such that everyone can hear his speech.## Sample Input 1

3 3 0 1 1 1 2 1

## Sample Output 1

1

## Sample Input 2

4 6 0 2 3 1 4 1 5 2

## Sample Output 2

2

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 14 | 20 | 1s | 256MB | Minimum |

2 | 16 | 20 | 1s | 256MB | Minimum |

3 | 21 | 20 | 1s | 256MB | Minimum |

4 | 49 | 20 | 1s | 256MB | Minimum |

5 | 0 | 2 | 1s | 256MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o speakers -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512