Harryxun/stf_run huggingface dataset:
import math

mod=1000000007

def lcm(x, y):
	return int((x*y)/math.gcd(x,y))

n=int(input())
l= list(map(int,input().split()))

lc= l[0]

for x in l:
	lc=lcm(lc,x)

ans=0
for x in l:
	ans+=int(lc/x)
	ans=ans%mod

print(int(ans))

### FIXED CODE ###

import math

mod=1000000007

count=[0 for i in range(1000005)]

def factorize(x):
	lim= int(math.sqrt(x))
	for i in range(2,lim+1):
		if x%i == 0:
			c=0
			while x%i==0:
				x/=i
				c+=1
			x=int(x)

			if count[i]<c: count[i]=c
	if x>1:	
		if count[x]<1: count[x]=1

def minus(ans,x):
	lim= int(math.sqrt(x))
	for i in range(2,lim+1):
		if x%i == 0:
			c=0
			while x%i==0:
				x/=i
				c+=1
			x=int(x)

			ans*= pow(pow(i,c),mod-2,mod)
			ans%=mod

	ans*= pow(pow(x,1),mod-2,mod)
	ans%=mod

	return int(ans)

n=int(input())
l= list(map(int,input().split()))

ans=0
for x in l:
	factorize(x)

ans=1
for i in range(1,1000005):
	ans*= pow(i,count[i],mod)
	ans%=mod

lc=ans
res=0
for x in l:
	res+=minus(lc,x)
	res%=mod

print(res)
# -*- coding: utf-8 -*-

N, M = map(int, input().split())

# 入力値の頂点ペア(辺)を格納する配列
a = [0] * N
b = [0] * N
# 頂点ペアが隣接しているかどうかを格納する配列
graph = [[False for i in range(N)] for j in range(N)]
# ある頂点が訪問済かどうかを格納する配列
visited = [False] * N

# 入力値の頂点ペア(辺)を格納していくループ
for i in range(M):
    a[i], b[i] = map(int, input().split())
    # 添字に合わせて入力値から1減らしておく
    a[i] -= 1
    b[i] -= 1
    # 入力値の内容に合わせて、隣接していることを記録
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

# 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
def dfs(v):
    # 関数内で使用する変数のglobal宣言
    global graph
    global visited
    # 通った頂点は訪問済にする
    visited[v] = True
    for v2 in range(N):
        # 隣接していないor訪問済はやる意味ないのでcontinue
        if graph[v][v2] == False or visited[v2] == True:
            continue
        # 調べる必要のある箇所は再帰的に調べていく
        dfs(v2)

ans = 0
# 各辺について、橋かどうかを判定していくループ
for i in range(M):
    # まず該当の辺を外す(この状態で連結ではなくなってしまえばそれは橋)
    graph[a[i]][b[i]] = False
    graph[b[i]][a[i]] = False
    # 訪問済判定を初期化
    for j in range(N):
        visited[j] = False
    # 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
    dfs(0)
    # 各頂点について、訪問済かどうかを確認していく
    bridge = False
    for j in range(N):
        # 頂点で一つでも未訪問の箇所があれば橋と判定する
        if visited[j] == False:
            bridge = True
    if bridge:
        ans += 1
    # 外した辺を元に戻す
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-

N, M = map(int, input().split())

# 入力値の頂点ペア(辺)を格納する配列
a = [0] * 50
b = [0] * 50
# 頂点ペアが隣接しているかどうかを格納する配列
graph = [[False for i in range(50)] for j in range(50)]
# ある頂点が訪問済かどうかを格納する配列
visited = [False] * N

# 入力値の頂点ペア(辺)を格納していくループ
for i in range(M):
    a[i], b[i] = map(int, input().split())
    # 添字に合わせて入力値から1減らしておく
    a[i] -= 1
    b[i] -= 1
    # 入力値の内容に合わせて、隣接していることを記録
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

# 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
def dfs(v):
    # 関数内で使用する変数のglobal宣言
    global graph
    global visited
    # 訪問済はやる意味ないのでreturn
    if visited[v]:
        return
    # 通った頂点は訪問済にする
    visited[v] = True
    for v2 in range(N):
        # 隣接している箇所は調べる
        if graph[v][v2]:
            # 調べる必要のある箇所は再帰的に調べていく
            dfs(v2)

ans = 0
# 各辺について、橋かどうかを判定していくループ
for i in range(M):
    # まず該当の辺を外す(この状態で連結ではなくなってしまえばそれは橋)
    graph[a[i]][b[i]] = False
    graph[b[i]][a[i]] = False
    # 訪問済判定を初期化
    for j in range(N):
        visited[j] = False
    # 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
    dfs(0)
    # 各頂点について、訪問済かどうかを確認していく
    bridge = False
    for j in range(N):
        # 頂点で一つでも未訪問の箇所があれば橋と判定する
        if visited[j] == False:
            bridge = True
    if bridge:
        ans += 1
    # 外した辺を元に戻す
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

print(ans)
def plus_and_check(list):
    sum_up = sum(list)
    while i > 0:
        number_1 = 10 * i
        number_2 = 10 * (i+1)
        if number_2 > sum_up and sum_up > number_1:
            return i
        else:
            continue
        i = i + 1

l = map(int, raw_input().split())
print "%d" % plus_and_check(l)

### FIXED CODE ###

import sys

a = []
answer_array = []
for line in sys.stdin:
    a.append(map(int, line.strip().split()))
    #except StopIteration:
        #break

for i in range(len(a)):
    sum_up = a[i][0] + a[i][1]

    answer = len(str(sum_up))

    answer_array.append(answer)

for j in range(len(answer_array)):
    print answer_array[j]
from collections import deque
from heapq import heapify, heappop, heappush, merge


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self._root(self.table[x])
            return self.table[x]

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            if d1 == d2:
                self.table[r1] -= 1
        else:
            self.table[r1] = r2


def solve(aa, uft):
    roots = {x: [] for x, r in enumerate(uft.table) if r < 0}
    if n < (len(roots) - 1) * 2:
        return 'Impossible'
    for x, a in enumerate(aa):
        roots[uft._root(x)].append(a)
    queue = []
    for l in roots.values():
        l.sort()
        queue.append(deque(l))
    heapify(queue)
    ans = 0
    while len(queue) > 1:
        dq1 = heappop(queue)
        dq2 = heappop(queue)
        ans += dq1.popleft() + dq2.popleft()
        heappush(queue, deque(merge(dq1, dq2)))
    return ans


n, m = map(int, input().split())
aa = list(map(int, input().split()))
uft = UnionFind(n)
for _ in range(m):
    uft.union(*map(int, input().split()))
print(solve(aa, uft))


### FIXED CODE ###

from collections import deque, defaultdict
from heapq import heapify, heappop, merge, heapreplace


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self._root(self.table[x])
            return self.table[x]

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            if d1 == d2:
                self.table[r1] -= 1
        else:
            self.table[r1] = r2


def solve(aa, uft):
    roots = defaultdict(list)
    for x, a in enumerate(aa):
        roots[uft._root(x)].append(a)
    if len(roots) == 1:
        return 0
    if n < (len(roots) - 1) * 2:
        return 'Impossible'
    ans = 0
    queue = []
    for l in roots.values():
        l.sort()
        ans += l[0]
        queue.append(l[1:])
    lm = n - m - 2
    if lm > 0:
        mm = merge(*queue)
        for _ in range(lm):
            ans += next(mm)
    return ans


n, m = map(int, input().split())
aa = list(map(int, input().split()))
uft = UnionFind(n)
for _ in range(m):
    uft.union(*map(int, input().split()))
print(solve(aa, uft))
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

### FIXED CODE ###

dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])
import sys
from numba import jit

@jit
def main():
  input = sys.stdin.readline
  
  N, W = map(int, input().split())
  L = [list(map(int,input().split())) for i in range(N)]
  dp = [[0] * (W + 1) for i in range(N + 1)]
  
  for i in range(N):
    weight = L[i][0]
    value = L[i][1]
    for w in range(W + 1):
      if w >= weight:
        dp[i + 1][w] = max(dp[i][w],dp[i][w - weight] + value)
      else:
        dp[i + 1][w] = dp[i][w]
        
  print(dp[-1][W])

if __name__ == '__main__':
  main()

### FIXED CODE ###

N, W = map(int, input().split())
L = sorted( [ [int(i) for i in input().split()] for _ in range(N) ] )

dp = [0] * (W + 1)
cnt = 0

for w, v in L:
    #重さを足し合わせていき合計を求める
    cnt = cnt + w
    #W=重さの制約とこれまでの重さの合計のうち、
    #小さい方から品物iの重さまで、逆順にfor文を回す
    ##3,8-5,...15-7
    for i in range(min(cnt, W), w - 1, -1):
        #同じ重さでより価値が高い組み合わせがあれば価値を更新する
        ## w < Wの制約があり、i - wとその値を参照してから更新しているため、
        ## Wの制約を満たさない値を持つことはない
        ### 方法上、持ち得ない重さに持ち得ない値がつくことがあるが、
        ### それらが解 = 最大値になることはない
        ### (解を求める過程でついでに足されたり足されなかったりするだけなので)
        if dp[i] < dp[i - w] + v:
            dp[i] = dp[i - w] + v

print(max(dp))
from decimal import Decimal
N = int(input())
M = N/Decimal(1.08)
if N == int(M*Decimal(1.08)) :
    print( int(M))
else :
    print(:()

### FIXED CODE ###

from decimal import Decimal
N = int(input())
M = int(N/Decimal(1.08)) + 1
if N == int(M*Decimal(1.08)) :
    print( int(M))
else :
    print(':(')
class Node:
    prev = next = None

    def __init__(self, value):
        self.value = value

    def get_nxnx(self):
        next_n = self.next
        if not next_n: return None, None
        return next_n, next_n.next

    def get_prpr(self):
        prev_n = self.prev
        if not prev_n: return None, None
        return prev_n, prev_n.prev

    def combine(self):
        next_n, nxnx_n = self.get_nxnx()
        if not next_n or not nxnx_n: return False

        if self.value > abs(next_n.value) < nxnx_n.value:
            self.value += next_n.value + nxnx_n.value
            self.next = nxnx_n.next
            _, prpr = self.get_prpr()
            if prpr:
                prpr.combine()
            return True
        return False

    def iter(self):
        a = self
        while a:
            yield a.value
            a = a.next


while True:
    n = int(input())
    if not n:
        break
    a0 = a = Node(int(input()))
    n -= 1
    while n:
        an = int(input())
        if an * a.value < 0:
            at = Node(an)
            at.prev = a
            a.next = at
            a = at
        else:
            a.value += an
        n -= 1
    if a0.value < 0:
        a0 = a0.next
    a = a0
    while a:
        while a.combine():
            pass
        _, a = a.get_nxnx()
    print(max(v for v in a0.iter()))

### FIXED CODE ###

while True:
    n = int(input())
    if not n:
        break
    a = [0] * n
    a[0] = int(input())
    for i in range(1, n):
        an = int(input())
        a[i] = max(an, a[i - 1] + an)
    print(max(a))
S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)

### FIXED CODE ###

S=list(input())
S.append(0)
count=0
people=0
x=[]
x.append(-1)
y=[]
z=[]
for i in range(10**5+1):
    if S[i]==0:
        All = i
        y.append(0)
        break
    if S[i]=='L':
        if S[i+1]=="R":
            x.append(i)
        if S[i+1]==0:
            x.append(i)
    if S[i]=="R":
        if S[i+1]=="L":
            y.append(i)
for j in range(All):
    if j == y[count]:
        people=x[count+1]-x[count]
        if(people%2==0):
            z.append(people//2)
            z.append(people//2)
        else:
            if((y[count]-x[count])%2!=0):
                z.append(people//2+1)
                z.append(people//2)
            else:
                z.append(people//2)
                z.append(people//2+1)
    elif j-1==y[count]:
        count+=1
    else:
        z.append(0)
print(*z)
a=list(map(input(). split() ) )
b=list(map(input(). split() ) )
if(a[0]==b[2]&&a[1] ==b[1] & & a[2] ==b[0] ):
       print ("Yes" )
else:
      print("No" ) 

### FIXED CODE ###

x = input()
y = input()
z = x[::-1]
if y==z:
        print("YES")
else:
        print("NO")
n=int(input())
c,f=0,0
while(n>0):
  a,b=map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c>=3):
    f=1
    break
  n-=1
if(f==1 or c>=3):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
if(s[-1]=='s'):
  s+='es'
else:
  s+='s'
print(s)
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7

S = input()
N = len(S)

# ランレングス圧縮
A = []
cnt = 1
for i in range(N-1):
    if S[i] == S[i+1]:
        cnt += 1
    else:
        A.append(cnt)
        cnt = 1
A.append(cnt)

# 例外処理
if len(A) <= 2:
    print(max(A))
    exit()

raise Exception
M = len(A)
ans = max(A[0], A[-1])
for i in range(1, M-1):
    ans = max(ans, min(A[i]+A[i-1], A[i]+A[i+1]))
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

"""
参考：https://img.atcoder.jp/arc088/editorial.pdf
・一番真ん中に近い境界の、始点か終点の遠い方の距離が最適
・中央付近から順に境界を1つずつ減らして最終的に全0にできる。
"""

S = input()

dist = float('inf')
for i in range(1, len(S)):
    if S[i] != S[i-1]:
        # 境界を見つけたら、始点か終点の遠い方の距離を取る
        tmp = max(i, len(S)-i)
        # この値が小さい程中央に近い位置
        if tmp < dist:
            dist = tmp
# 境界が1つもないなら、文字列の長さをそのまま使える
if dist == float('inf'):
    dist = len(S)

print(dist)
a,b,c=input();print(a[0]+b[1]+c[2])

### FIXED CODE ###

a,b,c=input(),input(),input();print(a[0]+b[1]+c[2])
import math
a,b,c,d=input().split(" ")
A=int(a)
B=int(b)
C=int(c)
D=int(d)
def nb_divisers(n,m):
    return n//m
def nb_d_btw(f,g,n):
    if f%n==0:
        print(nb_divisers(g,n)-nb_divisers(f,n)+1)
        return nb_divisers(g,n)-nb_divisers(f,n)+1
    else:
        print(nb_divisers(g,n)-nb_divisers(f,n))
        return nb_divisers(g,n)-nb_divisers(f,n)
def nb_notdivisers_f(a,b,c,d):
    e=int(c*d/math.gcd(c,d))
    return b-a+1-(nb_d_btw(a,b,c)+nb_d_btw(a,b,d)-nb_d_btw(a,b,e))
print(nb_notdivisers_f(A,B,C,D))

### FIXED CODE ###

A, B, C, D=(int(x) for x in input().split(" "))
import fractions

def eks(x,a):
    return a//x

def wai(x):
    return eks(x,B)-eks(x,A-1)

def lcm(a,b):
    return a*b//fractions.gcd(a,b)

zet=B-A+1-(wai(C)+wai(D)-wai(lcm(C,D)))
print (zet)
W, H, x, y, r = int(input().split())
if(x < r or y < r):
    print("No")
elif(x > (W - r) or y > (H - r)):
    print("No")
else:
    print("Yes")


### FIXED CODE ###

W, H, x, y, r = map(int, input().split())
if(x < r or y < r):
    print("No")
elif(x > (W - r) or y > (H - r)):
    print("No")
else:
    print("Yes")
n, d = map(int, input().split())
xy = []
for i in range(n):
  a, b = map(int, input().split())
  x.append([a, b])
 
count = 0
for xy in xy:
  count += xy[0]**2 + xy[1]**2 <= d**2
 
print(count)

### FIXED CODE ###

n, d = map(int, input().split())
x, y = [], []
for i in range(n):
  a, b = map(int, input().split())
  x.append(a)
  y.append(b)

count = 0
for xi, yi in zip(x, y):
  if xi**2 + yi**2 <= d**2:
    count += 1

print(count)
import math

mod_base = (10 ** 9) + 7
n, k = map(int, input().split(" "))
a = map(int, input().split(" "))
sa = sorted(a, reverse=True)

fact = list()
fact.append(1)

for i in range(1, n + 1):
    fact.append(fact[i - 1] * i)


def comb(a, b):
    return int(fact[a] / (fact[b] * fact[a - b]))

sum_max = 0
sum_min = 0
for i in range(0, n):
    sai = sa[i]

    if (n - i - 1) >= (k - 1):
        # print("max: sai:%d comb:%d" % (sai, comb(n - i - 1, k - 1)))
        sum_max = (sum_max + sai * comb(n - i - 1, k - 1)) % mod_base

    if i >= (k - 1):
        sum_min = (sum_min + sai * comb(i, k - 1)) % mod_base
        # print("min: sai:%d comb:%d" % (sai, comb(i, k - 1)))

# print("%d %d" % (sum_max, sum_min))
print((sum_max - sum_min) % mod_base)


### FIXED CODE ###

mod_base = (10 ** 9) + 7
n, k = map(int, input().split(" "))
a = map(int, input().split(" "))
sa = sorted(a, reverse=True)

fac = fac_inv = inv = list()


def comb_init(n_in, mod):
    global fac, fac_inv, inv
    fac = [1 for x in range(0, n_in + 1)]
    fac_inv = [1 for x in range(0, n_in + 1)]
    inv = [1 for x in range(0, n_in + 1)]
    # fac[0] = fac[1] = 1
    # fac_inv[0] = fac_inv[1] = 1
    # inv[0] = inv[1] = 1

    for i in range(2, n_in + 1):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        fac_inv[i] = fac_inv[i - 1] * inv[i] % mod


def comb(n_in, r, mod):
    if n_in < r:
        return 0
    elif n_in < 0 or r < 0:
        return 0
    else:
        return fac[n_in] * (fac_inv[r] * fac_inv[n_in - r] % mod) % mod


comb_init(n, mod_base)

sum_max = 0
sum_min = 0
for i in range(0, n):
    sai = sa[i]

    if (n - i - 1) >= (k - 1):
        # print("max: sai:%d comb:%d" % (sai, comb(n - i - 1, k - 1)))
        sum_max = (sum_max + sai * comb(n - i - 1, k - 1, mod_base)) % mod_base

    if i >= (k - 1):
        sum_min = (sum_min + sai * comb(i, k - 1, mod_base)) % mod_base
        # print("min: sai:%d comb:%d" % (sai, comb(i, k - 1)))

# print("%d %d" % (sum_max, sum_min))
print((sum_max - sum_min) % mod_base)
import sys
sys.setrecursionlimit(10000)

N = int(input())
W = [list(map(int, input().split())) for _ in range(N-1)]
nodes = [[] for _ in range(N+1)]
for w in W:
    nodes[w[0]].append((w[1], w[2]))
    nodes[w[1]].append((w[0], w[2]))
ans = [-1] * (N+1)
ans[1] = 0
def search(num, root, dis):
    for node in nodes[num]:
        sum_d = dis
        if node[0] != root:
            idx = node[0]
            sum_d += node[1]%2
            if sum_d%2 != 0:
                ans[idx] = 1
            else:
                ans[idx] = 0
            search(idx, num, sum_d)

search(1, 0, 0)
for answer in ans[1:]:
    print(answer)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N = int(input())
W = [list(map(int, input().split())) for _ in range(N-1)]
nodes = [[] for _ in range(N+1)]
for w in W:
    nodes[w[0]].append((w[1], w[2]))
    nodes[w[1]].append((w[0], w[2]))
ans = [-1] * (N+1)
ans[1] = 0
def search(num, root, dis):
    for node in nodes[num]:
        sum_d = dis
        if node[0] != root:
            idx = node[0]
            sum_d += node[1]%2
            if sum_d%2 != 0:
                ans[idx] = 1
            else:
                ans[idx] = 0
            search(idx, num, sum_d)

search(1, 0, 0)
for answer in ans[1:]:
    print(answer)
N, W = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for _ in range(W+10)] for _ in range(N+10)]
for i, (item_weight, item_value) in enumerate(items):  # i番目の品
    for total_weight in range(W):                      # 重さの合計
        dp[i+1][total_weight+item_weight] = max(dp[i][total_weight]+item_value, dp[i+1][total_weight+item_weight])
        dp[i+1][total_weight] = max(dp[i][total_weight], dp[i+1][total_weight])
        
print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
items = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for _ in range(W+10)] for _ in range(N+10)]

for i, (item_weight, item_value) in enumerate(items):
    for total_weight in range(W+1):
        if (total_weight-item_weight) >= 0:
            dp[i+1][total_weight] = max(dp[i][total_weight-item_weight] + item_value, dp[i+1][total_weight])
        dp[i+1][total_weight] = max(dp[i+1][total_weight], dp[i][total_weight])
        
print(dp[N][W])
S=input()
ls=[]
tmp=0
aaa=['A', 'T', 'G', 'C']
for i in range(len(S)):
	if S[i] not in aaa:
		ls.append(tmp)
		tmp=0
		continue
	else:
		tmp+=1
print(max(ls))

### FIXED CODE ###

S=input()
ls=[]
tmp=0
aaa=['A', 'T', 'G', 'C']
for i in range(len(S)):
	if S[i] not in aaa:
		ls.append(tmp)
		tmp=0
		continue
	else:
		tmp+=1
ls.append(tmp)
print(max(ls))
x, y = list(map(int, input().split()))

a = int(x)
b = int(y)

product = a*b

if product % 2 = 0:
	print("Even")
else:
	print("Odd")


### FIXED CODE ###

x, y = list(map(int, input().split()))
 
a = int(x)
b = int(y)
 
product = a*b
 
if product % 2 == 0:
	print("Even")
else:
	print("Odd")
import math
a=10**9+7
N,K=map(int,input().split())
gcd=[0]*(K+1)
ans=0
multipleNumber
for i in reversed(range(1,K+1)):
    multipleNumber=math.floor(K/i)
    totalNumber=multipleNumber**N
    if 2*i<=K:
        minus=range(2*i,K+1,i)
        for j in minus:
            totalNumber-=gcd[j]
    gcd[i]=totalNumber
for i in range(1,len(gcd)):
    ans+=i*gcd[i]
print(ans)

### FIXED CODE ###

mod=10**9+7
N,K=map(int,input().split())
d=[0]*(K+1)
ans=0
for i in range(1,K+1):
    d[i]=pow(K//i,N,mod)
for i in range(K,0,-1):
    for j in range(2*i,K+1,i):
        d[i]-=d[j]
        d[i]%=mod
    ans+=d[i]*i
    ans%=mod
print(ans)
X = int(input())
b = 1.0
c = True

while c:
    if ((X + b**5)**0.2).is_integer():
        c = False
        a = int(((X + b**5)**0.2))
    elif b > 0:
        b = -1*b
    else:
        b = -1*b + 1
        
print(a, int(b))

### FIXED CODE ###

X = int(input())

c = 1
result = False


while not result:
    for i in range(c):
        a = c -i
        b = i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        b = c - i
        a = - i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        a = -c+i
        b = -i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    for i in range(c):
        a = i
        b = -c + i
        if a**5 - b**5 == X:
            result = True
            A = a
            B = b
            break
    if result == True:
        break
    c += 1

print(A, B)
x=int(input())
ans=0
for b in range(2,x):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)


### FIXED CODE ###

a,b,c,d=map(int,input().split())
print("Yes" if ((abs(a-b)<=d and abs(b-c)<=d) or abs(a-c)<=d) else "No")
from numba import jit
import math
X = int(input())


@jit
def solver(X):
    sol = []
    i = 2
    while i <= math.sqrt(X)+1:
        if X % i == 0:
            sol.append(i)
        i += 1
    return sol


if X == 1:
    print(0, -1)
    exit()
sol = solver(X)


for i in sol:
    for s in range(-130 130):
        t = s - i
        if s ** 5 - t ** 5 == X:
            print(s, t)
            break


### FIXED CODE ###


X = int(input())


for i in range(-120, 120):
    for j in range(-120,120):
        if i ** 5 - j ** 5 == X:
            print(i, j)
            exit()