Problem: http://community.topcoder.com/stat?c=problem_statement&pm=2226
Analysis: https://community.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm205
Problem: http://community.topcoder.com/stat?c=problem_statement&pm=2226
Analysis: https://community.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm205