optimized icpc2004rB