← Back to List

12971번: 숫자 놀이 ↗

Solutions

Python 3
191 B | 191 chars
def solution():
  l=[*map(int,input().split())]
  for i in range(1, 40000000):
    if i % l[0] == l[3] and i % l[1] == l[4] and i % l[2] == l[5]:
      return i
  return -1

print(solution())