optimized icpc 2013dC (achieved 0.00s on AOJ)