QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 256 MB Points totaux : 100

#21108. Bò chạy bộ

Statistiques

$N$ bò của Farmer John ($1 \leq N \leq 100,000$) lại rèn móng, chạy trên đường vô hạn. Vị trí ban đầu khác nhau và một số tốc độ khác nhau.

Đường chia thành làn để vượt nhau. Hai bò cùng làn không bao giờ được cùng vị trí. Không muốn đổi làn hay tốc độ, ông hỏi cần bao nhiêu làn khi chạy $T$ phút ($1 \leq T \leq 1,000,000,000$).

Dữ liệu vào

Dòng đầu chứa $N$, $T$.

$N$ dòng tiếp chứa vị trí ban đầu và tốc độ một bò. Vị trí nguyên không âm, tốc độ nguyên dương; cả hai tối đa một tỷ. Vị trí khác nhau và được cho theo thứ tự tăng.

Dữ liệu ra

In một số nguyên: số làn ít nhất để hai bò cùng làn không bao giờ cùng vị trí, kể cả thời điểm $T$.

Ví dụ

Dữ liệu vào 1

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

Dữ liệu ra 1

3

Tác giả bài toán: Mark Gordon, 2014

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.