Divisble subarrays

https://ide.codingblocks.com/s/40959
my code for https://hack.codingblocks.com/contests/c/512/266
It is passing all test cases, in the contest, but it is failing 2 test cases when I am trying ti submit it to the online course questions https://online.codingblocks.com/player/10922/content/4829?s=1640

what’s wrong with the code?

pls help, thanks.