interval.cpp problem ID: 1330