Sichuan University Programming Contest 2006 Preliminary

G: Alice and Bob