code chef august challenge


Question has been edited due to ongoing contest..
//