2003' ACM/ICPCѵϰ 14

E: Longest Match