Site Message
Only Premium Users can view the Question
This was the Bonus problem, asked by Google London in one of the interviews, its solution is directly available over the internet but that is just a direct formula, even this problem can be beautifully solved using simple BFS
If you wish to learn from CF Master ( 2171 ) for upcoming Internship / Placement Season apply here : Application Form