some progress
time limit exceeding. :( :(
use int whereever possible..... it is faster.
fixed bug.

power method num should be long OR casted to long before being squared.

still exceeds time :( :( :(