Sichuan University Programming Contest 2007 Preliminary

E: Endless Wars