Runtime error in factor tree

https://www.codechef.com/viewsolution/32013462

can someone please help me understand the error