Problem statement clarification:
Now I get it, I was misinterpreting question all thi...
Nice problem for begineers