An example of output

Each line specifies an interval. E.g., the first line specifies the interval [1,3]. All the lines together should form the maximum weight non-overlapping path.
1 3
4 10 
12 18
...