got the problem.

printf was the problem.... but then again time exceeded. :( :(