Sichuan University Programming Contest 2007 warmup - SCU 2007 warmup contest 13

B: (i,j)