SPOJ(ADAMONEY) Problem

can anybody tell me where I went wrong. compiler showing Segmentation Fault in matrix Exponentian problem
problem link - https://www.spoj.com/problems/ADAMONEY/
Solution - https://ide.codingblocks.com/s/135541

@Saurabh-Kumar-1331476656958199 and @apaarkamal please at least reply