Question
Friendly Interval Merge
Given closed intervals and a grace gap
Input
First line: KaTeX can only parse string typed expression.
Next KaTeX can only parse string typed expression lines: KaTeX can only parse string typed expression.
Output
Print the number of merged blocks and then the blocks in increasing order.
Example
Input:
5 2
1 3
6 8
9 10
20 22
23 23Output:3
1 3
6 10
20 23