logo AlgoBeat OnlineJudge
登录 注册

#203863. [USACO14DEC] Cow Jog G

内存限制:125 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Farmer John's cows are out exercising their hooves again, jogging along an infinite track. Each cow starts at a distinct position on the track, and some cows run at different speeds.

The track is divided into lanes so that cows may move past each other. No two cows in the same lane may ever occupy the same position. Farmer John doesn't want any cow to have to change lanes or adjust speed, and he wonders how many lanes he will need to accomplish this if the cows are going to run for minutes

输入格式

The first line of input contains and .

The following lines each contain the initial position and speed of a single cow. Position is a nonnegative integer and speed is a positive integer; both numbers are at most 1 billion. All cows start at distinct positions, and these will be given in increasing order in the input.

输出格式

A single integer indicating the minimum number of lanes necessary so that no two cows in the same lane ever occupy the same location (including at time ).

样例

样例输入 1

5 3
0 1
1 2
2 3
3 2
6 1

样例输出 1

3