题目描述
Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings.
The entire horizon is represented by a number line with N N ( ) buildings. Building i’s silhouette has a base that spans locations Ai A i through Bi B i along the horizon ( 1≤A