Comments

I sympathize with you because I have come to this day

If you want to modulo division, you should use the inverse.

Maybe you need to open a larger array and set it as a global variable