c语言刷题 一直tle

数字整除问题,但是一直超过时间限制 不知道怎么改才能减少循环时间

img