SCU practice contest 3 for grade 2010 new ACMers

E: A simple problem with interval