TopCoder SRM616_div2_3.cpp: fix bug, forget to check whether overlap or not