def get_maxgys(a,b): if a<b: a,b=b,a while b: a, b = b, a%b return a while True: try: n,a=list(map(int,input().split())) # lst=list(map(int,input().split())) lst=[] for i in range(n): lst.append(int(input())) nlz=a for i in lst: if i<=nlz: nlz+=i else: nlz+=get_maxgys(nlz,i) print(nlz) except: break