(B*n + C)%A == 0 を満たす、n を探そうと思った。
具体的には n を 1 から 10**6 まで全探索すれば一通り探索するイメージ。
Amax100,Bmax100,C<B だから、行けるでしょ。
ChooseIntegers.py
A,B,C = map(int,input().split())
for n in range(1,1+10**6):
if (B*n+C)%A == 0:
print("YES")
exit()
print("NO")
うん。文章をそのまま書いてみた。
Sentou.py
N,T = map(int,input().split())
t = list(map(int,input().split()))
score = 0
for i in range(N-1):
if t[i+1]-t[i] < T:
score += t[i+1]-t[i]
else:
score += T
print(score+T)