All the TCs giving TLE ! in Game Theory - 2 problem

my sol : https://ide.codingblocks.com/s/264594

i m not able to understand why my code is giving TLE !

according to me my sol is totally optimal.

can u pls tell me where my code is going wrong ??

You have a mistake in divisors function, you are not checking whether inserted number is actually divisible or not!

oh… kk thnx for ur help it got ac !