I am trying to solve the problem for a while but couldn't come up an idea. It would be great if someone can help me to solve the problem. Details explanation would be better. Problem Link: https://vjudge.net/problem/LightOJ-1032
Thanks a lot :) sorry for my poor English. :)