Redirecting you to http://uva.onlinejudge.org/external/102/10260.pdf