Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

count = 0
result = []

def get(x):
  if x == "r":
    return ("p", P)
  elif x == "s":
    return ("r", R)
  elif x == "p":
    return ("s", S)


for i in range(N):
  x = T[i]
  hand, point = get(x)
  if i < K:
    # 前回の結果は気にしなくても良いとき
    result.append((hand, point))
  elif hand != result[i-K][0]:
    result.append((hand, point))
  else:
    if i + K >= N:
      # 後のことを考えなくて良いとき
      result.append((hand, 0))
    else:
      next = list(filter(lambda x: x not in (T[i+2], hand), ["r", "s", "p"]))[0]
      result.append((next, 0))

print(sum(list(map(lambda x: x[1], result))))



### FIXED CODE ###




N, K = map(int,input().split())
R, S, P = map(int, input().split())
T = input()

point = 0

judge = {"r": R, "s": S, "p": P}
skip = [False] * N

for i in range(N):
  if i < K:
    if T[i] == "r":
      point += judge["p"]
    elif T[i] == "s":
      point += judge["r"]
    elif T[i] == "p":
      point += judge["s"]
  else:
    # K回前を意識しないといけない
    if T[i-K] != T[i] or skip[i-K]:
      if T[i] == "r":
        point += judge["p"]
      elif T[i] == "s":
        point += judge["r"]
      elif T[i] == "p":
        point += judge["s"]
    else:
      skip[i] = True
      
print(point)
n, t = map(int,input().split())
mydict = {}
for i in range(n):
  a, b = map(int,input().split())
  mydict.setdefault(a, b)
sortedDict = sorted(mydict.items())
k = 0
for j in sortedDict:
  k += 1
  if j[1] <= t:
    print(j[0])
    break
  if k == len(sortedDict):
  	print("TLE")
	break

### FIXED CODE ###

n,t = map(int, input().split())
a = []
b = 0
for i in range(n):
  l = list(map(int, input().split()))
  a.append(l)
a.sort()
for i in range(n):
  if a[i][1] <= t:
    b = a[i][0]
    break
if b > 0:
  print(b)
else:
  print("TLE")
n = input()
negBase = -2

if (n == 0): 
        return "0"
  
    converted = "01"
    while (n != 0): 
      
        remainder = n % (negBase) 
        n = int(n/negBase) 
  
        if (remainder < 0): 
            remainder += ((-1) * negBase) 
            n += 1
  
        converted = str(remainder) + converted

### FIXED CODE ###

a = int(input(""))
list = []
if(a == 0):
    list.append(0)
while(a):
    if(a%(-2)==0):
        list.append(0)
        a//=-2
    elif(a%(-2)==-1):
        list.append(1)
        a -= 1
        a//=-2

list.reverse()
for i in list:print(i,end='')
print()
n,k = map(int,input().split())
A = list(map(int,(input().split())))

cnt=0
C=[]
for i in range(len(A)):
    for j in range(len(A)):
        if A[i]>A[j]:
            cnt= cnt+1

print((cnt*k*(k+1)(/2%(10**9+7))

### FIXED CODE ###

n,k = map(int,input().split())
A = list(map(int,(input().split())))

#1つの箱の中の数を数える
cnt1=0
for i in range(n):
    for j in range(i,n):
        if A[i]>A[j]:
            cnt1+=1

#2つの箱の大小を調べる
B=A
cnt2=0
for i in range(n):
    for j in range(n):
        if B[i]>A[j]:
            cnt2+=1
ans = (cnt1*k + cnt2 * k*(k-1)//2)%(10**9+7)
print(ans)
import heapq
n,m= map(int,input().split())
feeindays = [[] for _ in range(m)]
for i in range(n):
    a,b= map(int,input().split())
    feeindays[a-1]+=[b]
q=[]
heapq.heapify(q)
pay=0
for l in feeindays:
    for c in l:heapq.heappush(q,-c)
    if len(q)!=0:pay+=-1 * heapq.heappop(q)
print(pay)

### FIXED CODE ###

import heapq
n,m= map(int,input().split())
feeindays = [[] for _ in range(m)]
for i in range(n):
    a,b= map(int,input().split())
    if a<=m:feeindays[a-1]+=[b]
q=[]
heapq.heapify(q)
pay=0
for l in feeindays:
    for c in l:heapq.heappush(q,-c)
    if len(q)!=0:pay+=-1 * heapq.heappop(q)
print(pay)
r, a = map(int, input().split())
print(2*a-r)

### FIXED CODE ###

r = int(input())
a = int(input())
print(a*2-r)
# coding: utf-8 
# Your code here!
import sys 
sys.setrecursionlimit(10000000000)

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

l=[[i] for i in range(N)] 

#print(l) 
def dfs(num,point,visited): 
    visited[num]=1 
    point+=plus[num] 
    
    ans[num]=point 
    while l[num][-1]!=num: 
        temp=l[num].pop(-1) 
        if visited[temp]==0: 
            dfs(temp,point,visited) 
            
    return 0 

for _ in range(N-1): 
    a,b=map(int,input().split()) 
    l[a-1].append(b-1) 
    l[b-1].append(a-1) 
    
ans=[0]*N 
plus=[0]*N 

for _ in range(Q): 
    p,x=map(int,input().split()) 
    plus[p-1]+=x 

dfs(0,0,[0]*N) 

print(*ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
#パクリゆるして
#グラフのようななにか

import sys
input=sys.stdin.readline
sys.setrecursionlimit(1000000)

from collections import deque


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

tree=[[]*(N+1) for i in range(N+1)]
point=[0]*(N+1)

for _ in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    
for _ in range(Q):
    p,x=map(int,input().split())
    point[p]+=x
#print(point)

d=deque([[1,0]])

while d:
    node,parent=d.popleft()
    point[node]+=point[parent]
    lis=tree[node]
    for child in lis:
        if child==parent:
            continue
        d.append([child,node])
    #print(d)

print(*point[1:])
import bisect
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
app = [0 for i in range(n+1)]
mod = 10**9+7
pair = []
for i in range(n):
  x = a[i]
  if app[x] != 0 and i != app[x]:
    pair.append([app[x],i+1])
  app[x] = i+1
pair.sort()
ps = len(pair)
ans = 1
cntls = []
order = []
sumtot = []
for i in range(ps-1,-1,-1):
  [s,t] = pair[i]
  if i == ps-1:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,1])
  elif t>-cntls[0][0]:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,sumtot[-1][1]+1])
  else:
    x = bisect.bisect_right(order,-t)
    cntls.append([-s,sumtot[x-1][1]+1])
    order.append(-s)
    sumtot.append([-s,(sumtot[-1][1]+sumtot[x-1][1]+1)%mod])
print((sumtot[-1][1]+1)%mod)

### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
app = [0 for i in range(200001)]
mod = 10**9+7
pair = []
for i in range(n):
  x = a[i]
  if app[x] != 0 and i != app[x]:
    pair.append([app[x],i+1])
  app[x] = i+1
pair.sort()
ps = len(pair)
cntls = []
order = []
sumtot = []
for i in range(ps-1,-1,-1):
  [s,t] = pair[i]
  if i == ps-1:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,1])
  elif t>-cntls[0][0]:
    cntls.append([-s,1])
    order.append(-s)
    sumtot.append([-s,sumtot[-1][1]+1])
  else:
    x = bisect.bisect_right(order,-t)
    cntls.append([-s,sumtot[x-1][1]+1])
    order.append(-s)
    sumtot.append([-s,(sumtot[-1][1]+sumtot[x-1][1]+1)%mod])
if pair == []:
  print(1)
else:
  print((sumtot[-1][1]+1)%mod)
N, Q = map(int, input().split())
A = [[] for _ in range(N)]
for _ in range(N-1):
    i, k = map(int, input().split())
    A[i-1].append(k-1)
    A[k-1].append(i-1)
n_P = [0] * N
for _ in range(Q):
    k, n = map(int, input().split())
    n_P[k-1] += n
ans = [0] * N
visited = [0] * N
def make(num, p):
    ans[num] += n_P[num] 
    ans[num] += p
    visited[num] = 1
    for i in A[num]:
        if visited[i] == 0:
            make(i,ans[num])
    return
for i in range(N):
    if visited[i] == 0:
        make(i, ans[i])
print(*ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2*10**9)
N, Q = map(int, input().split())
A = [[] for _ in range(N)]
for _ in range(N-1):
    i, k = map(int, input().split())
    A[i-1].append(k-1)
    A[k-1].append(i-1)
n_P = [0] * N
for _ in range(Q):
    k, n = map(int, input().split())
    n_P[k-1] += n
ans = [0] * N
visited = [0] * N
def make(num, p):
    ans[num] += n_P[num] 
    ans[num] += p
    visited[num] = 1
    for i in A[num]:
        if visited[i] == 0:
            make(i,ans[num])
    return
make(0, ans[0])
print(*ans)
import numpy as np
 
K = int(input())
ans = 0
for i in range(1,K+1):
    ans += np.gcd.reduce([i,i,i])

for i in range(1, K):
    for j in range(i+1, K+1):
        ans += 3 * np.gcd.reduce([i,j,j])
for i in range(1, K+1):
    for j in range(1, i):
        ans += 3 * np.gcd.reduce([i,j,j])
        
for i in range(1, K-1):
    for j in range(i+1, K):
        for k in range(j+1, K+1):
            ans += 6 * np.gcd.reduce([i,j,k])
            
print(ans)

### FIXED CODE ###

import numpy as np
 
K = int(input())
ans = 0

gcd2 = np.zeros((K+1, K+1), dtype=int)

for i in range(1, K):
    for j in range(i+1,K+1):
        gcd2[i,j] = gcd2[j,i] = np.gcd(i,j)
for i in range(1, K+1):
    gcd2[i,i] = i

for i in range(1,K+1):
    ans += i

for i in range(1, K):
    for j in range(i+1, K+1):
        ans += 3 * gcd2[i,j]
for i in range(1, K+1):
    for j in range(1, i):
        ans += 3 * gcd2[i,j]
        
for i in range(1, K-1):
    for j in range(i+1, K):
        for k in range(j+1, K+1):
            ans += 6 * gcd2[i,gcd2[j,k]]
            
print(ans)
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.array(lr(), dtype=np.int32)
counter = np.bincount(A)
case = (counter * (counter-1) // 2).sum()
answer = case - (counter[A] - 1)
print('\n'.join(map(str, answer)))


### FIXED CODE ###

import sys
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
counter = Counter(A)
total = sum(x*(x-1)//2 for x in counter.values())
for a in A:
    x = counter[a]
    temp = total
    temp -= x * (x-1) // 2
    if x > 2:
        temp += (x-1) * (x-2) // 2
    print(temp)
import math
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [a//2 for a in A]

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

k = A[0]
for a in A[1:]:
    k = lcm(a, k)

M = M - (M % k)
b = M % 2
if b == 1:
    print((M / k)+1/2)
else:
    print((M / k) / 2)

### FIXED CODE ###

from fractions import gcd
import sys
input = sys.stdin.readline

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = [a//2 for a in A]

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

k = A[0]
for a in A[1:]:
    k = lcm(a, k)

M = M - (M % k)
b = M // k


if b % 2 == 0:
    r = int(b/2)
else:
    r = int((b + 1) / 2)

for a in A[1:]:
    if k // a % 2 == 0:
        r = 0
        break

print(r)
n,k = map(int, input().split( ))
if n==k:
    print(0)
    exit()
#h = [0]+h#h[0]=0追加
inf = 10**15

dp = [[inf]*n for _ in range(n+1)] #dp[i][j]右端がi、j+1本残す
mn = h[0]
for i in range(n):
    #mn = min(mn,h[i])
    dp[i][0] = h[i]#min(mn,h[i])

for i in range(1,n):##右端
    for j in range(i+1):#本数
        for t in range(j-1,i):#右から2番目,
            dp[i][j] = min(dp[i][j], dp[t][j-1] + max(h[i]-h[t], 0))

ans = inf 

for i in range(n):
    ans = min(ans, min(dp[i][n-k-1:]))###
print(ans)


### FIXED CODE ###

n,k = map(int, input().split( ))
if n==k:
    print(0)
    exit()
h = list(map(int, input().split( )))
#h = [0]+h#h[0]=0追加
inf = 10**15

dp = [[inf]*n for _ in range(n+1)] #dp[i][j]右端がi、j+1本残す
mn = h[0]
for i in range(n):
    #mn = min(mn,h[i])
    dp[i][0] = h[i]#min(mn,h[i])

for i in range(1,n):##右端
    for j in range(i+1):#本数
        for t in range(j-1,i):#右から2番目,
            dp[i][j] = min(dp[i][j], dp[t][j-1] + max(h[i]-h[t], 0))

ans = inf 

for i in range(n):
    ans = min(ans, min(dp[i][n-k-1:]))###
print(ans)
from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a, b=x+dx[k], y+dy[k]
      if a<0 or a>=H or b<0 or b>=W or count[a][b]!=-1:
        continue
      else:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
        max_x=a
        max_y=b
  return count[max_x][max_y]
print(bfs(H,W,l))
    

### FIXED CODE ###

from collections import deque
H,W=map(int,input().split())

l=[input() for _ in range(H)]


def bfs(H,W,l):
  ans=0
  que=deque()
  count=[[-1]*W for _ in range(H)]
  num=H*W
  dx=[1,-1,0,0]
  dy=[0,0,1,-1]
  for i in range(H):
    for j in range(W):
      if l[i][j]=='#':
        count[i][j]=0
        que.append([i,j])
        num-=1
  while num>0:
    x,y=que.popleft()
    for k in range(4):
      a, b=x+dx[k], y+dy[k]
      if a<0 or a>=H or b<0 or b>=W or count[a][b]!=-1:
        continue
      else:
        count[a][b]=count[x][y]+1
        que.append([a,b])
        num-=1
  for i in range(H):
    ans=max(ans,max(count[i]))
  return ans
print(bfs(H,W,l))
#!/usr/bin/env python
# coding: utf-8

# In[1]:


import numpy as np


# In[2]:


H, W = map(int, input().split())
S = np.ones((H, W), dtype=np.bool)
for i in range(H):
    S[i] = [s == "." for s in input()]


# In[3]:


up = np.zeros((H, W), dtype=np.int16)
down = np.zeros((H, W), dtype=np.int16)
left = np.zeros((H, W), dtype=np.int16)
right = np.zeros((H, W), dtype=np.int16)

# up
up[0, :] = S[0, :]
for h in range(1, H):
    up[h, :] = up[h - 1, :] + 1
    up[h, :] *= S[h, :]

# down
down[H - 1, :] = S[H - 1, :]
for h in reversed(range(0, H - 1)):
    down[h, :] = down[h + 1, :] + 1
    down[h, :] *= S[h, :]

# left
left[:, 0] = S[:, 0]
for w in range(1, W):
    left[:, w] = left[:, w - 1] + 1
    left[:, w] *= S[:, w]

# right
right[:, W - 1] = S[:, W - 1]
for w in reversed(range(0, W - 1)):
    right[:, w] = right[:, w + 1] + 1
    right[:, w] *= S[:, w]

ans = np.max(up + down + left + right - 3)
print(ans)


# In[ ]:






### FIXED CODE ###

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

# In[1]:


import numpy as np


# In[2]:


H, W = map(int, input().split())
S = np.ones((H, W), dtype=np.bool)
for i in range(H):
    S[i] = [s == "." for s in input()]


# In[3]:


up = np.zeros((H, W), dtype=np.int16)
down = np.zeros((H, W), dtype=np.int16)
left = np.zeros((H, W), dtype=np.int16)
right = np.zeros((H, W), dtype=np.int16)

# up
up[0, :] = S[0, :]
for h in range(1, H):
    up[h, :] = up[h - 1, :] + 1
    up[h, :] *= S[h, :]

# down
down[H - 1, :] = S[H - 1, :]
for h in reversed(range(0, H - 1)):
    down[h, :] = down[h + 1, :] + 1
    down[h, :] *= S[h, :]

# left
left[:, 0] = S[:, 0]
for w in range(1, W):
    left[:, w] = left[:, w - 1] + 1
    left[:, w] *= S[:, w]

# right
right[:, W - 1] = S[:, W - 1]
for w in reversed(range(0, W - 1)):
    right[:, w] = right[:, w + 1] + 1
    right[:, w] *= S[:, w]

ans = np.max(up + down + left + right - 3)
print(ans)


# In[ ]:
N, M = map(int, input().split())
#N = 1
#M = 1
l1 = []
l2 = []
ans = 0
rest = M
for i in range(N):
	temp1, temp2 = map(int, input().split())
	#temp1 = 1
	#temp2 = 1
	l1.append(temp1)
	l2.append(temp2)

while True:
	min_index = l1.index(min(l1))
	if(rest >= l2[min_index]):
		ans += (min(l1) * l2[min_index])
		rest -= l2[min_index]
	else :
		ans += (min(l1) * rest)
		break
	l1.pop(min_index)

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
X = []
for i in range(N):
    X.append(list(map(int, input().split())))
X.sort(key=lambda x: x[0])
i = 0
num = 0
ans = 0
while i <= N - 1:
    num += X[i][1]
    ans += X[i][0] * X[i][1]
    if num > M:
        ans -= X[i][0] * (num - M)
        break
    i += 1
print(ans)
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1)
        if max(xn) < i and min(ym)>=i:
            print("War")
            exit
    else:
        print("No War")
else:
    print("No War")

### FIXED CODE ###

# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
for i in range(N):
	ans+=B[A[i]]
	if A[i]==A[i-1]+1:
		ans+=C[A[i-1]]
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.append(100)
B.append(100)
C.insert(0,0)
ans=0
for i in range(1,N+1):
	ans+=B[A[i-1]-1]
	if A[i-1]==A[i]-1:
		ans+=C[A[i-1]]
print(ans)
S=input()
T=input()
if S == T[:len(T)-1]:
  print("Yes")
 else:
  print("No")

### FIXED CODE ###

S=input()
T=input()
if S == T[:len(T)-1]:
      print("Yes")
else:
      print("No")
N = int(input())
xys = []
for i in range(N):
    x,y = map(int, input().split())
    xys.append((x,y))

xys.sort()
diffs = []
count = []
# 全探索して、一番共通項が多い差分から計算する
for i in range(N):
    for j in range(i+1,N):
        x1,y1 = xys[i]
        x2,y2 = xys[j]
        diff = (x1-x2, y1-y2)
        if diff not in diffs:
            diffs.append(diff)
            count.append(1)
        else:
            k = diffs.index(diff)
            count[k] += 1

print(N-max(count))

### FIXED CODE ###

N = int(input())
xys = []
for i in range(N):
    x,y = map(int, input().split())
    xys.append((x,y))

xys.sort()
diffs = []
count = []
# 全探索して、一番共通項が多い差分から計算する
for i in range(N):
    for j in range(i+1,N):
        x1,y1 = xys[i]
        x2,y2 = xys[j]
        diff = (x1-x2, y1-y2)
        if diff not in diffs:
            diffs.append(diff)
            count.append(1)
        else:
            k = diffs.index(diff)
            count[k] += 1
if N == 1:
    print(1)
else:
    print(N-max(count))
import sys
import numpy as np

# 黒: #
# 白: .

H, W = input().split()

H = int(H)
W = int(W)

A = np.zeros([H,W])

for i in range(H):
    chars = np.array(list(input()))
    A[i,:] = np.where(chars=='.', 0, 1)

cnt = 0
w_num = np.sum(A == 0)

while w_num != 0:
    cnt += 1
    B = np.zeros([H,W])
    for i in range(W):
        for j in range(H):
            if A[i,j] == 1:
                B[i,j] = 1
                if i-1 >= 0:
                    B[i-1,j] = 1
                if i+1 < W:
                    B[i+1,j] = 1
                if j-1 >= 0:
                    B[i,j-1] = 1
                if j+1 < H:
                    B[i,j+1] = 1

    w_num = np.sum(B == 0)
    A = B

print(cnt)

### FIXED CODE ###

def main():
    H, W = map(int, input().split())
    field = [list(input()) for _ in range(H)]
    dd = ((1, 0), (-1, 0), (0, 1), (0, -1))

    q = []
    for i in range(H):
        for j in range(W):
            if field[i][j] == "#":
                q.append((i, j))
                field[i][j] = 0
    moves = 0

    while q:
        qn = []
        moves += 1
        for x, y in q:
            for dx, dy in dd:
                nx, ny = int(x + dx), int(y + dy)
                if 0 <= nx < H and 0 <= ny < W:
                    if field[nx][ny] == ".":
                        field[nx][ny] = moves
                        qn.append((nx, ny))

        q = qn

    m = []
    for i in range(H):
        m.append(max(field[i]))
    print(max(m))


main()
N = int(input())
A = list(map(int, input().split()))
A.reverse()
sum = 0
xor = 0
cnt = [[0]*2]*N
for i in range(1, N):
    if A[i] in cnt:
        sum += cnt[A[i]][0]
        for j in range(cnt[A[i]][1], i):
            a = A[i] ^ A[j]
            xor += a
            sum += a
        cnt[A[i]][0] = xor + cnt[A[i]][0]
        cnt[A[i]][1] = i
    else:
        for j in range(i):
            a = A[i] ^ A[j]
            xor += a
            sum += a
        cnt[A[i]][0] = xor
        cnt[A[i]][1] = i
print(sum%1000000007)

### FIXED CODE ###

import numpy as np
MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

ans = 0
twopow = 1
for n in range(60):
    tmp = A & 1
    one = np.count_nonzero(tmp)
    zero = N - one
    ans = (ans + (one * zero) * twopow) % MOD
    A >>= 1
    twopow = twopow << 1 % MOD

print(ans)
P = []
S = []
T = []
 for i in range(N):
    pp, ss, t  = map(int, input().split())
    P.append(pp)
    S.append(ss)
    T.append(t)

A = P[0]
V = P[1]
B = S[0]
W = S[1]
T = T[0]

def run():
    if A < B:
        c = (B + V*T) - (A + W*T)
        if c =< 0 :
            return 'YES'
        else :
            return 'NO'
    else:
        c =  (B - V*T) - (A - W*T)
            if c >= 0 :
                return 'YES'
            else :
                return 'NO'

### FIXED CODE ###

P = []
S = []
for i in range(2):
    pp, ss  = map(int, input().split())
    P.append(pp)
    S.append(ss)

A = P[0]
V = S[0]
B = P[1]
W = S[1]
T = int(input())

def run():
	if A < B:
		c = (B + W*T) - (A + V*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	elif A > B:
		c =  (A - V*T) - (B - W*T)
		if c <= 0 :
			return 'YES'
		else :
			return 'NO'
	else :
		return 'YES'
print(run())
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

A, B, C = map(int, input().split())
C_list = []
if A >= B:
    num = A % B
    while num not in C_list:
        C_list.append(num)
        num += A % B
        if num >= B:
            num -= B
elif A < B:
    num = A
    while num not in C_list:
        C_list.append(num)
        num += A
        if num >= B:
            num -= B
print('YES' if C in C_list else 'NO')
a=[]
while True:
    b=input()
    if b=="":
        break
    else:
        a=a+[str(x) for x in b.lower().replace(" ","",100)]
    print(a)
for i in "abcdefghijklmnopqrstuvwxyz":
    counter=0
    for j in a:
        if i==j:
            counter+=1
    print(str(i)+" : "+str(counter))

### FIXED CODE ###

import sys
cnts = {}
for line in sys.stdin:
    for c in list(line.lower()): cnts[c] = cnts.get(c,0) + 1
  
for c in range(ord('a'),ord('z')+1): print(chr(c),':',cnts.get(chr(c),0))
def evenodd(a, b):
  sum = a + b
  sumto = sum % 2
  if sumto = 1:
    response = 'Odd'
  else:
    response = 'Even'
  return response

### FIXED CODE ###

a, b = map(int, input().split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = 'Odd'
else :
  response = 'Even'
print(response)