Link to the problem- SPREAD Problem - CodeChef Link to my submission - CodeChef: Practical coding for everyone