Company: Walmart_12march
Difficulty: medium
Hand Elevation Disparity Problem Description Professor Elena Ivanovna oversees a history class with N students. Homework assigned for the day comprises M topics. Due to time constraints, each student has only managed to study topics ranging from li to ri, inclusively. At the start of the lesson, every student positions their hand at 0. The instructor proceeds to inquire about each topic in turn: If a student has studied topic k, they raise their hand by 1; otherwise, they lower it by 1. Each topic may only be queried once by Professor Elena Ivanovna. The task at hand is to determine the maximum disparity between the highest and lowest hand elevations that could result in the class following this survey. It's crucial to note that a student's hand may descend below 0. Input Format The first line of the input contains two integer N and M representing the number of students and the number of topics respectively. Each of the next N lines of each test case contain two integers li and ri repr