Why this matrix multiplication is going into infinite loop for n=3000? I have tested using n=2000 and it is working fine, but I dont know what is happening when I am using N=300