Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())
edge=[]
for i in range(m):
    a, b, c = map(int, input().split())
    edge.append([a,b,-c])

def BellmanFord(edges,num_v,source):
  #グラフの初期化
  dist=[inf for i in range(num_v)]
  dist[source-1]=0
  #辺の緩和
  for i in range(num_v):
    for e in edges:
      if e[0] != inf and dist[e[1]-1] > dist[e[0]-1] + e[2]:
        dist[e[1]-1] = dist[e[0]-1] + e[2]
        if i == num_v-1:dist[e[1]-1] = inf

  return dist

d = BellmanFord(edge,n,1)

if d[n-1]==inf:
    print("inf")
else:
    print(-d[n-1])

### FIXED CODE ###

from itertools import accumulate
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = float('inf')
from functools import reduce

n,m = map(int,input().split())
edge=[]
for i in range(m):
    a, b, c = map(int, input().split())
    edge.append([a,b,-c])

dist = [inf]*n
dist[0] = 0
for i in range(1,n):
    for j in range(m):
        if dist[edge[j][1]-1] > dist[edge[j][0]-1]+edge[j][2]:
            dist[edge[j][1]-1] = dist[edge[j][0]-1]+edge[j][2]

ans = dist[n-1]

for j in range(m):
    if dist[edge[j][1]-1] > dist[edge[j][0]-1]+edge[j][2]:
        dist[edge[j][1]-1] = dist[edge[j][0]-1]+edge[j][2]
if dist[n-1]<ans:
    print("inf")
else:
    print(-ans)
n = int(input())
c = input()
cl = list(c)
wi = 0
wnum=0
ri = n-1
rnum=0
br=0
bw=0
for i in range(n):
    while(cl[wi] == "R" and bw==0):
        wi+=1
        if(wi >= n-1):
            bw=1
            break
    if(cl[wi] == "W"):
        wnum+=1
    wi+=1
    if(wi >= n-1):
        wi=0
        bw=1
    while(cl[ri] == "W" and br==0):
        ri-=1
        if(ri <= 0):
            br=1
            break
    if(cl[ri] == "R"):
        rnum+=1
    ri-=1
    if(ri <= 0):
        ri=n-1
        br=1
    if(ri < wi):
        res1 = i+1
    if(br*bw==1):
        break
print(min(res1, rnum, wnum))

### FIXED CODE ###

n = int(input())
c = input()
cl = list(c)
wi = 0
wnum=0
ri = n-1
rnum=0
br=0
bw=0
res1 = n
break1 = 0
for i in range(n):
    while(cl[wi] == "R" and bw==0):
        wi+=1
        if(wi >= n-1):
            bw=1
            break
    if(cl[wi] == "W"):
        wnum+=1
    while(cl[ri] == "W" and br==0):
        ri-=1
        if(ri <= 0):
            br=1
            break
    if(cl[ri] == "R"):
        rnum+=1
    if(ri < wi and break1 == 0):
        res1 = i
        break1 = 1
    wi+=1
    if(wi >= n-1):
        wi=0
        bw=1
    ri-=1
    if(ri <= 0):
        ri=n-1
        br=1

    if(br*bw==1):
        break
print(min(res1, rnum, wnum))
#!/usr/bin/env python
# -*- coding:utf-8 -*-

def main():
	PI = 3.14159265359
	r = int(raw_input())
	print ("%.8f %.8f"%(r**2*PI,r*2*PI))
	
if __name__ == '__main__':
	main()

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding:utf-8 -*-

def main():
	PI = 3.14159265359
	r = float(raw_input())
	print ("%.8f %.8f"%(r**2*PI,r*2*PI))
	
if __name__ == '__main__':
	main()
import math
N, M = map(int, input().split())
S = list(input())
T = list(input())

lcm = (N * M) // math.gcd(N, M)
ans = lcm
ansS = ["0"]*lcm
ansT = ["0"]*lcm
Sp = lcm//N
Tp = lcm//M

for i in range(10000000000):
    if Sp*i > lcm:
        break
    if i > N-1:
        break
    ansS[Sp*i] = S[i]

for i in range(10000000000):
    if Tp*i > lcm:
        break
    if i > M-1:
        break
    ansT[Tp*i] = T[i]

for i in range(lcm):
    if ansS[i] == "0" or ansT[i] == "0":
        continue
    if ansS[i] != ansT[i]:
        ans = -1
        break

print(ans)

### FIXED CODE ###

import math
N, M = map(int, input().split())
S = list(input())
T = list(input())
lcm = (N * M) // math.gcd(N, M)
ans = lcm
Sp = lcm//N
Tp = lcm//M
lcmlcm = (Sp * Tp) // math.gcd(Sp, Tp)
owari = min(Sp*N, M*Tp)
for i in range(0, owari, lcmlcm):
    if S[i//Sp] != T[i//Tp]:
        ans = -1
        break
print(ans)
N,T=map(int,input().split())
ct = [[0,0] for i in range N]
for i in range(N):
  ct[i]=list(map(int,input().split()))
ct.append([-1,T])
ct.sort(reverse=True,key=lambda x:x[1])
index = ct.index([-1,T])
if index==0:
  print("TLE")
else:
  ans = sorted(ct[:index],key=lambda x:x[0])
  print(ans[0][0])

### FIXED CODE ###

N,T=map(int,input().split())
ct = [[0,0] for i in range(N)]
for i in range(N):
  ct[i]=list(map(int,input().split()))
ct.append([-1,T])
ct.sort(key=lambda x:x[1])
index = ct.index([-1,T])
if index==0:
  print("TLE")
else:
  ans = sorted(ct[:index],key=lambda x:x[0])
  print(ans[0][0])
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


N = read_a_int()
H = read_ints()

# https://atcoder.jp/contests/dp/tasks/dp_a
# 全探索ではナンセンス(というより処理が終わらない)
# i+1 or i+2のうち小さい方を選びつづければいいということにすぐに気がつく
# こういったように、今の状態から次の状態が決まるときはDPが使えることがおおい(この問題はgreedy気味にも捉えることができるが。)
# 途中までの状態が決まれば、最善手を選ぶことで次の状態が決定できるのを実装する。
# 今回の場合だったらhまでの最善の状態というのはmin(2つ前までの最善の状態+差, 1つ前までの最善の状態+差)なのでこれでdpテーブルを埋めていくことができる。
# こういった最小化問題はinfで初期化すると良い

import numpy as np
dp = np.full((N+2), np.inf, dtype='int64')
dp[0] = 0
dp[1] = abs(H[0] - H[1])

# この概念はいわゆる貰うDP
# for i in range(2, N):
#     dp[i] = min(dp[i - 1] + abs(H[i - 1] - H[i]),
#                 dp[i - 2] + abs(H[i] - H[i - 2]))

# print(dp[-1])

# 配るDPで実装してみる
for i in range(0, N):
    dp[i + 1] = min(dp[i] + abs(H[i] - H[i+1]), dp[i+1])
    dp[i + 2] = min(dp[i] + abs(H[i] - H[i+2]), dp[i+2])

print(dp[N-1])


### FIXED CODE ###

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


N = read_a_int()
H = read_ints()

# https://atcoder.jp/contests/dp/tasks/dp_a
# 全探索ではナンセンス(というより処理が終わらない)
# i+1 or i+2のうち小さい方を選びつづければいいということにすぐに気がつく
# こういったように、今の状態から次の状態が決まるときはDPが使えることがおおい(この問題はgreedy気味にも捉えることができるが。)
# 途中までの状態が決まれば、最善手を選ぶことで次の状態が決定できるのを実装する。
# 今回の場合だったらhまでの最善の状態というのはmin(2つ前までの最善の状態+差, 1つ前までの最善の状態+差)なのでこれでdpテーブルを埋めていくことができる。

import numpy as np
dp = np.zeros((N), dtype='int64')
dp[1] = abs(H[0] - H[1])

for i in range(2, N):
    dp[i] = min(dp[i - 1] + abs(H[i - 1] - H[i]),
                dp[i - 2] + abs(H[i] - H[i - 2]))

print(dp[-1])
import sys
from collections import Counter

input = sys.stdin.readline

n = int(input())
s = [input() for i in range(n)]

c_sort = collections.Counter(s).most_common()
list_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]
for i in list_most:
    print(i)

### FIXED CODE ###

import collections

n = int(input())
s = [input() for _ in range(n)]
c_sort = collections.Counter(s).most_common()
list_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]
for i in sorted(list_most):
    print(i)
n = int(input())

a = list(map(int, input().split()))
a.sort()


from functools import lru_cache
import sys
if n == 2:
    print(max(a))
    sys.exit()


@lru_cache(maxsize=100000)
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


def gcd_list(li):
    g = gcd(li[0], li[1])
    for i in range(2, len(li)):
        g = gcd(g, li[i])
    return g


def gcd_list_2(li):
    g = gcd(li[0], li[1])
    if g == 1:
        return max(gcd_list([li[0]] + li[2:]), gcd_list(li[1:]))
    for i in range(2, n):
        if gcd(g, li[i]) == 1:
            return gcd_list([g] + li[i + 1:])
        else:
            g = gcd(g, li[i])
    return g


def max_gcd(a):
    g = gcd_list(a)
    a = [a[i]//g for i in range(n)]
    m = gcd_list_2(a)
    print(g * m)


max_gcd(a)

### FIXED CODE ###


n = int(input())

a = list(map(int, input().split()))
a.sort(reverse=True)


from functools import lru_cache
import sys
if n == 2:
    print(max(a))
    sys.exit()


@lru_cache(maxsize=100000)
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x


def gcd_list(li):
    if len(li) == 1:
        return li[0]
    g = gcd(li[0], li[1])
    for i in range(2, len(li)):
        g = gcd(g, li[i])
    return g


def gcd_list_2(li):
    g = gcd(li[0], li[1])
    if g == 1:
        return max(gcd_list([li[0]] + li[2:]), gcd_list(li[1:]))
    for i in range(2, n):
        if gcd(g, li[i]) == 1:
            if i == n - 1:
                return gcd_list(li[:i])
            gg = gcd_list(li[i+1:])
            bb = [gcd(li[x], gg) for x in range(i+1)]
            bb.sort()
            return bb[1]
        else:
            g = gcd(g, li[i])
    return g


def max_gcd(a):
    g = gcd_list(a)
    a = [a[i]//g for i in range(n)]
    m = gcd_list_2(a)
    print(g * m)


max_gcd(a)
S = int(input())
ko = ":"
print("S[0:2]" + ko + S[2:3] + ko + S[3:5])

### FIXED CODE ###

S = int(input())
h = int(S / (60 * 60))
m = int(S / 60) % 60
s = S % 60

print('{}:{}:{}'.format(h,m,s))
A = list(map(int,input().split()))
B = set(A)
if A.count(B[0]) == 1:
  print(B[0])
else:
  print(B[1])

### FIXED CODE ###

A = list(map(int,input().split()))
B = list(set(A))
if A.count(B[0]) == 1:
  print(B[0])
else:
  print(B[1])
N, K = (int(i) for i in input().split())  

def dfs(a, b, c):
  lis = [''.join([str(a), str(b), str(c)])]
  if max(a, b, c) > N:
    return []
  
  lis += dfs(a + K, b, c)
  lis += dfs(a, b + K, c)
  lis += dfs(a, b, c + K)
  return lis

ans = 0
l = []
if K % 2 == 0:
  l += dfs(K//2, K//2, K//2)
  l += dfs(K, K, K)
else:
  l += dfs(K, K, K)

print(len(set(l)))

### FIXED CODE ###

N, K = (int(i) for i in input().split())  
ans = 0
if K % 2 == 0:
  ans += (N//(K//2) - N//K) ** 3
  ans += (N//K) ** 3
else:
  ans += (N//K) ** 3

print(ans)
H, W = map( int, input().split() )
abc = [ chr(i) for i in range( 65, 65+26 ) ]
for i in range(H) : 
    s = list( map( str, input().split() ) )
    for j in range(W) :
        if "snuke" in s : 
           w = abc[ s.index[ "snuke" ] ]
           h = i + 1
           break
print( w + str( h ) )

### FIXED CODE ###

H, W = map( int, input().split() )
s = [ list( map( str, input().split() ) ) for i in range(H) ] 
for i in range(H) : 
    for j in range(W) : 
       if s[i][j] == "snuke" : 
           w = chr( j + ord( "A" ) )
           h = i + 1
           print( w + str( h ) )
           exit()
N,K=map(int,input().split())
X=list(map(int,input().split()))
ans=float('inf')
for i in range(N-K+1):
  	l=i
    r=l+K-1
    ans=min(ans,min(abs(X[l]),abs(X[r]))+X[r]-X[l])
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
X=list(map(int,input().split()))
ans=float('inf')
for l in range(N-K+1):
    r=l+K-1
    ans=min(ans,min(abs(X[l]),abs(X[r]))+X[r]-X[l])
print(ans)
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
if not(2 in a):
    print(-1)

x = [False]*N
n,i = (1, 0)
while x[n] == False:
    x[n] = True
    n = a[n-1]
    i+=1
    if n==2:
        print(i)
        break
else:
    print(-1)

### FIXED CODE ###

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))
x = [False]*N
n,i = (0, 0)
while x[n] == False:
    x[n] = True
    n = a[n]-1
    i+=1
    if n==1:
        print(i)
        break
else:
    print(-1)
1 <= a <= b <=20

a,b=(int(x) for x in input().split())


if b % a == 0:
    print(a + b)
else :
    print(a - b)


### FIXED CODE ###

a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


if b % a == 0:
    print(a + b)
else :
    print(b - a)
a,b,c=int(input())
if a==b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c=input()
if a==c:
  print("Yes")
else:
  print("No")
n=int(input())
s=input()
for i in range(len(s)):
  s[i]=chr((ord(s[i])-ord('A')+n)%26+ord('A'))
print(s)

### FIXED CODE ###

n = int(input())
s = list(input())
for i in range(len(s)):
    s[i] = chr((ord(s[i]) - 65 + n) % 26 + 65)
print(''.join(s))
A, B = map(int, input().split())

import math

print(int((A * B )/math.gcd(A, B)))

### FIXED CODE ###

from fractions import gcd

A, B = map(int, input().split())

print(str((A * B) // gcd(A, B)))
a = int(input())
b = int(input())
c = a*b

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

### FIXED CODE ###

a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")
s = input()

YYMM = False
MMYY = False
month = []
for i in range(1,13):
  if len(str(i))==1:
    month.append("0"+str(i))
  else:
    month.append(str(i))
    
if s[:2] in month:
  MMYY = True
  
if[2:] in month:
  YYMM = True
  
if MMYY is True and YYMM is True:
  print("AMBIGUOUS")
elif MMYY is True and YYMM is False:
  print("MMYY")
elif MMYY is False and YYMM is True:
  print("YYMM")
else:
  print("NA")

### FIXED CODE ###

s = input()

YYMM = False
MMYY = False
month = []
for i in range(1,13):
  if len(str(i))==1:
    month.append("0"+str(i))
  else:
    month.append(str(i))
    
if s[:2] in month:
  MMYY = True
  
if s[2:] in month:
  YYMM = True
  
if MMYY is True and YYMM is True:
  print("AMBIGUOUS")
elif MMYY is True and YYMM is False:
  print("MMYY")
elif MMYY is False and YYMM is True:
  print("YYMM")
else:
  print("NA")
import re
index = re.search(input(),(hi)+)
if index:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import re
index = re.fullmatch(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")
import sys
from collections import Counter


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    N = int(input())
    S = input()
    C = Counter(S)
    r = C.get("R")
    g = C.get("G")
    b = C.get("B")
    answer = r * g * b
    for left in range(N):
        for mid in range(left + 1, N):
            right = mid * 2 - left
            if right < N:
                if S[right] != S[mid] and S[mid] != S[left] and S[right] != S[left]:
                    answer -= 1
    print(answer)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import Counter


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    S = input()
    C = Counter(S)
    R = C.get("R", 0)
    G = C.get("G", 0)
    B = C.get("B", 0)
    ans = R * G * B
    for left in range(N):
        for mid in range(left + 1, N):
            right = mid + mid - left
            if right < N:
                if S[right] != S[mid] and S[mid] != S[left] and S[right] != S[left]:
                    ans -= 1
    print(ans)


if __name__ == "__main__":
    main()
from math import log2

N = int(input())
A = [int(i) for i in input().split()]

maxdig = int(log2(max(A)))

ans = 0
for i in range(maxdig, -1, -1):
  d = 2**i
  cnt1 = 0
  for j in range(N):
    if A[j]//d > 0:
      cnt1 += 1
      A[j] -= d
  ans += cnt1*(N-cnt1)*d

print(ans%1000000007)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

maxdig = 60
mod = 10**9+7

ans = 0
for i in range(60+1):
  cnt1 = sum([1 for a in A if (a >> i) & 1])
  ans += (cnt1*(N-cnt1)*(1<<i))
  ans = ans%mod

print(ans)
a, b ,c = map(int, input().split())

if a == c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

number = input()
if number[0] == number[2]:
  print("Yes")
else:
  print("No")
from collections import deque
import sys
input=sys.stdin.readline

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False for _ in range(w)]+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    loc = [(1, 0), (-1, 0), (0, 1), (0, -1)]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[j+1][i+1] = True

    while q:
        x, y, z = q.popleft()
        for i, j in loc:
            x0 = x+j
            y0 = y+i
            if not counts[x0][y0]:
                counts[x0][y0] = True
                q.append([x0, y0, z+1])
    print(z)

cal()


### FIXED CODE ###

from collections import deque

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False]*w+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[i+1][j+1] = True

    while q:
        x, y, z = q.popleft()    
        if not counts[x+1][y]:
            counts[x+1][y] = True
            q.append([x+1, y, z+1])
        if not counts[x-1][y]:
            counts[x-1][y] = True
            q.append([x-1, y, z+1])
        if not counts[x][y+1]:
            counts[x][y+1] = True
            q.append([x, y+1, z+1])
        if not counts[x][y-1]:
            counts[x][y-1] = True
            q.append([x, y-1, z+1])
    print(z)
    

cal()
N = input()
str = [input() for i in range(N)]
print str
a = str[0]
b = str[1]
h = str[2]

S = (a + b) * h / 2
print(S)

### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
 
print(int((a+b)*h//2))
n, m = map(int, input().split())

G = [[] for _ in range(m)]
for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append(v)
    G[v].append(u)

ans = [-1] * n
ans[0] = 'Yes'

from collections import deque

q = deque([0])

pos = 0
while q:
    _q = q.popleft()
    for x in G[_q]:
        if ans[x-1] == -1:
            ans[x-1] = _q
            q.append(x-1)

if -1 in ans:
    print('No')
else:
    print('Yes')
    for _ans in ans[1:]:
        print(_ans+1)


### FIXED CODE ###

n, m = map(int, input().split())

G = [[] for _ in range(n)]
for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    G[u].append(v)
    G[v].append(u)

ans = [-1] * n

from collections import deque

q = deque([0])

while q:
    _q = q.popleft()
    for x in G[_q]:
        if ans[x] == -1:
            ans[x] = _q + 1
            q.append(x)

if -1 in ans:
    print('No')
else:
    ans[0] = 'Yes'
    for _ans in ans:
        print(_ans)
#f

n = int(input())
E = [[] for _ in range(n)]
mod = 10**9 + 7

for i in range(n-1):
    a,b = [int(x) for x in input().split()]
    E[a-1].append((b-1, i)) 
    E[b-1].append((a-1, i)) 
    
X = [0] * n
    
def dfs(u,e):
    num = 1
    for v,c in E[u]:
        if c != e:
            num += dfs(v,c)
    X[e] = num 
    return num

dfs(0, -1)

I = [1]
for i in range(n):
    I.append(I[-1] * pow(2, mod-2, mod) % mod)

ans = 0
for i in range(n):
    x = X[i]
    ans += (1-I[x])*(1-I[n-x])
    
ans -= n * I[1]
ans += 1 - I[n]
ans %= mod
print(ans)



### FIXED CODE ###

#f
import sys
sys.setrecursionlimit(2 * 10 ** 5 + 10)
 

n = int(input())
E = [[] for _ in range(n)]
mod = 10**9 + 7

for i in range(n-1):
    a,b = [int(x) for x in input().split()]
    E[a-1].append((b-1, i)) 
    E[b-1].append((a-1, i)) 
    
X = [0] * n
    
def dfs(u,e):
    num = 1
    for v,c in E[u]:
        if c != e:
            num += dfs(v,c)
    X[e] = num 
    return num

dfs(0, -1)

I = [1]
inv = pow(2, mod-2, mod)
for i in range(n):
    I.append(I[-1] * inv % mod)

ans = 0
for i in range(n):
    x = X[i]
    ans += (1-I[x])*(1-I[n-x]) % mod
    
ans -= n * I[1]
ans += 1 - I[n]
ans %= mod
print(ans)
n = int(input())
a = list(map(int,input().split()))

max = (10 ** 9) + 7

sum = 0
for i in range (n-1):
    for j in range (n):
        if i > j:
            continue
        if i != j:
            sum += a[i]*a[j]
#        if sum > max:
#            sum - max

if sum > max:
    ans = sum % max

print(ans)


### FIXED CODE ###

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

max = (10 ** 9) + 7

#一列の総和
wa = 0
for i in range (n):
    wa += a[i]

#a11, a22, ...の総和
rem = 0
for i in range(n):
    rem += a[i]*a[i]

sum = ((wa*wa) - rem) // 2

ans = sum % max

print(ans)
s = input()
res = 0
for i in range(len(s)//2):
	if s[i] != s[len(s)-1-i]:
        res += 1
print(res)

### FIXED CODE ###

s = input()
res = 0
for i in range(len(s) // 2):
    if s[i] != s[len(s)-1-i]:
        res += 1
print(res)
a.b.c.d.e.k=map(int,input().split())
if abs(a-b)>k or abs(a-c)>k or abs(a-d)>k or abs(a-e)>k or abs(b-c)>k or abs(b-d)>k or abs(b-e)>k or abs(c-d)>k or abs(c-e)>k or abs(d-e)>k:
  print(":(")
else:
  print("Yey!")


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a > k:
    print(":(")
elif e - b > k:
    print(":(")
elif e - c > k:
    print(":(")
elif e - d > k:
    print(":(")
else:
    print("Yay!")
N = input().split
 
if N == list(reversed(N)):
    print("Yes")

### FIXED CODE ###

N = input()

N1 = N[2]+N[1]+N[0]
if N == N1:
    print("Yes")
else:
    print("No")
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.06)-a))
print(a.index(min(a))+1)
  

### FIXED CODE ###

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.006)-a))
print(ans.index(min(ans))+1)
D,T,S =(int(x) for x in input().split(","))

if (D<=T*S):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

D,T,S =(int(x) for x in input().split())

if (D<=T*S):
    print("Yes")
else:
    print("No")
#! /usr/bin/env python3

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

N, A, B = [int(_) for _ in input().split()]


a = N / (A+B)
b = N % (A+B)
if b > A:
    b = A

print(int(a * A + b))

### FIXED CODE ###

#! /usr/bin/env python3

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

N, A, B = [int(_) for _ in input().split()]


a = N // (A+B)
b = N % (A+B)
if b > A:
    b = A

print(int(a * A + b))