This problem is written in latex notation, thats why I am not able to understand it. Is there any decoded version of it?
http://vjudge.net/problem/SPOJ-CZ_PROB1