Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import copy
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl,reverse=True)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      for k in dicr:
        if i < k:
          rest = k-i
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k+1] += 1
          break
    else:
      for k in dicl:
        if i > k:
          rest = i-k
          if rest%2 == 0:
            mass[k] += 1
          else:
            mass[k-1] += 1
          break
mass = [str(m) for m in mass]
print(' '.join(mass))

### FIXED CODE ###

import bisect
N = list(input())
nums = len(N)
mass = [1 for _ in range(nums)]

prev = N[0]
dicr = []
dicl = []
all = []
for i in range(1, len(N)):
  if prev == "R" and N[i] == "L":
    dicr.append(i-1)
    dicl.append(i)
    all.append(i)
    all.append(i-1)
  prev = N[i]
all = set(all)
dicr = sorted(dicr)
dicl = sorted(dicl)
for i in range(len(N)):
  if i not in all:
    mass[i] = 0
    if N[i] == "R":
      ind = dicr[bisect.bisect_left(dicr, i)]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind+1] += 1
    else:
      ind = dicl[bisect.bisect_left(dicl, i)-1]
      rest = ind-i
      if rest%2 == 0:
        mass[ind] += 1
      else:
        mass[ind-1] += 1
mass = [str(m) for m in mass]
print(' '.join(mass))
### BUGGY CODE ###

sn,bn=map(int,input().split(" "))
fubensa=[int(sn*(sn-1)/2)]
if bn>1:
    br=[]
    for _ in range(bn):
        br.append(list(map(int, input().split(" "))))
    br=br[::-1]
    sg=[0 for n in range(sn+1)]
    sg[br[0][0]]=1
    sg[br[0][1]]=1
    gn=1
    fubensa.append(fubensa[0]-1)
    sgc=[0,2]

    for bri in range(1,bn-1):
        si1=br[bri][0]
        si2=br[bri][1]
        sg1=sg[si1]
        sg2=sg[si2]
        if sg1+sg2==0:
            gn+=1
            sg[si1],sg[si2]=gn,gn
            sgc.append(2)
            fubensa.append(fubensa[bri]-1)
        elif sg1==0:
            fubensa.append(fubensa[bri] - sgc[sg2])
            sg[si1]=sg2
            sgc[sg2]+=1
        elif sg2==0:
            fubensa.append(fubensa[bri] - sgc[sg1])
            sg[si2]=sg1
            sgc[sg1] += 1
        elif sg1!=sg2:
            fubensa.append(fubensa[bri] - sgc[sg1]*sgc[sg2])
            if sgc[sg1]<sgc[sg2]:
                sg1,sg2=sg2,sg1
            sgc[sg1]+=sgc[sg2]
            sg=[sg1 if x==sg2 else x for x in sg]
        else:
            fubensa.append(fubensa[bri])
for x in fubensa[::-1]:
    print(x)

### FIXED CODE ###

sn,bn=map(int,input().split(" "))
fu=[int(sn*(sn-1)/2)]
gr_si=[n for n in range(sn+1)]
siL_gr=[[n] for n in range(sn+1)]
siL_br=[]
for _ in range(bn):
    siL_br.append(list(map(int, input().split(" "))))
siL_br=siL_br[::-1]

for bri in range(bn-1):
    si1,si2=siL_br[bri]
    gr1 = gr_si[si1]
    gr2 = gr_si[si2]
    if gr1==gr2:
        fu.append(fu[bri])
    else:
        lengr1 = len(siL_gr[gr1])
        lengr2 = len(siL_gr[gr2])
        if lengr1<lengr2:
            gr1,gr2=gr2,gr1
        fu.append(fu[bri]-lengr1*lengr2)
        for si in siL_gr[gr2]:
            gr_si[si]=gr1
        siL_gr[gr1]+=siL_gr[gr2]
        siL_gr[gr2]=[]

print(*fu[::-1],sep="\n")
### BUGGY CODE ###

from collections import deque

H, W = map(int, input().split())
grid = [input() for i in range(H)]

# 初期の黒('#')の位置からの距離
dist = [[-1]*W for _ in range(H)]
black_cells = deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == '#':
            black_cells.append((h, w))
            dist[h][w] = 0

def bfs(black_cells, dist):
    d = 0
    while black_cells:
        # キューとして使うのでpop()ではなくpopleft()
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:  # セルが白('.')であるのと同義
                dist[new_h][new_w] = d+1
                black_cells.append((new_h, new_w))
    return d

d = bfs(black_cells, dist)
print(d)

### FIXED CODE ###

from collections import deque
 
def solve(h, w, a):
    used = [[True] * (w+2) for _ in range(h+2)]
    que = deque()
    for r in range(h):
        used[r+1][1:-1] = map(lambda _:_=="#", a[r])
        for c in range(w):
            if a[r][c] == "#":
                que.append((r+1, c+1, 0))
    neighbors = [(1,0), (0,1), (-1,0), (0,-1)]
    while que:
        r, c, k = que.popleft()
        for dr, dc in neighbors:
            nr, nc = r+dr, c+dc
            if not used[nr][nc]:
                que.append((nr, nc, k+1))
                used[nr][nc] = True
    return k
 
h, w = map(int, input().split())
a = [input() for _ in range(h)]
print(solve(h, w, a))
### BUGGY CODE ###

n,k=map(int,input().split())
*h,=map(int,input().split())

dp=[0]*n
for i in range(1,n):
    dpmin=[]
    for j in range(max(0,i-k),i):
        dpmin.append(dp[j]+abs(h[i]-h[j]))
    dp[i]=min(dpmin)
print(dp[-1])

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
a = [0] * n
a[0] = 0
for i in range(1, n):
      hi = h[i]
      a[i] = min(a[j] + abs(hi - h[j]) for j in range(max(0, i - k), i))
print(a[-1])
### BUGGY CODE ###

import numpy as np
import math 
n = int(input())
s = input()
a = np.zeros(n)
rgb = [[] for _ in range(3)]
rgb2 = np.zeros((3,n), int)
idx = {'R':0, 'G':1, 'B':2}
for i in range(n):
  rgb[idx[s[i]]].append(i)
  rgb2[idx[s[i]]][i] = 1
#

counts = 0
for i in rgb[0]:
  for j in rgb[1]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0 and rgb2[2][((i+j)//2)] == 1):
        counts += 1
for i in rgb[0]:
  for j in rgb[2]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0 and rgb2[1][(i+j)//2] == 1):
      counts += 1
for i in rgb[1]:
  for j in rgb[2]:
    if(i+j >= 2*n-1):
      break
    if((i+j)%2 == 0 and rgb2[0][(i+j)//2] == 1):
      counts += 1
print(len(rgb[0])*len(rgb[1])*len(rgb[2]) - counts)


### FIXED CODE ###

import numpy as np
n = int(input())
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')

counts = 0
for i in range(n):
  for j in range(i+1, n):
    k = 2*j-i
    if(k >= n):
      break
    if(s[i] != s[j] and s[j]!=s[k] and s[k]!=s[i]):
      counts += 1
print(r*g*b - counts)
### BUGGY CODE ###

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

a=[]
b=[]
INF=10**9
dp=[INF for i in range(h+10**4)]

for i in range(n):
  p,q=map(int,input().split())
  a.append(p)
  b.append(q)

dp[0]=0
for i in range(h):
  if dp[i]==INF:
    continue
  for j in range(n):
    if dp[i+a[j]]>=dp[i]+b[j]:
      dp[i+a[j]]=dp[i]+b[j]
print(min(dp[h:]))

### FIXED CODE ###

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

a=[]
b=[]
INF=10**9
dp=[INF for i in range(h+10**4)]

for i in range(n):
  p,q=map(int,input().split())
  a.append(p)
  b.append(q)

dp[0]=0
for i in range(h):
  if dp[i]==INF:
    continue
  for j in range(n):
    if dp[i+a[j]]>=dp[i]+b[j]:
      dp[i+a[j]]=dp[i]+b[j]
print(min(dp[h:]))
### BUGGY CODE ###

from bisect import bisect_right as br
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
s, t = 0, 0
for i in range(N):
    s ^= A[i]
    t ^= B[i]
ans = (s ^ t) * (N % 2)
for k in range(1, 29):
    m = (1<<k) - 1
    AA = sorted([a & m for a in A])
    BB = [a & m for a in B]
    ans ^= (sum([N - br(AA, (1<<k) - b - 1) for b in BB]) % 2) << k

print(ans)

### FIXED CODE ###

from bisect import bisect_right as br
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
s, t = 0, 0
for i in range(N):
    s ^= A[i]
    t ^= B[i]
ans = (s ^ t) * (N % 2)
for k in range(1, 29):
    m = (1<<k) - 1
    AA = sorted([a & m for a in A])
    BB = sorted([a & m for a in B])[::-1]
    m += 1
    i, j = 0, 0
    while i < N and AA[i] + BB[j] < m:
        i += 1
    s = 0
    while i < N:
        while j < N and AA[i] + BB[j] >= m:
            j += 1
        s += j
        i += 1
    ans ^= (s % 2) << k
print(ans)
### BUGGY CODE ###

from numba import njit

N=int(input())
S=input()
R=0
G=0
B=0
for i in range(N):
    s=S[i]
    if s=="R":
        R+=1
    elif s=="G":
        G+=1
    else:
        B+=1
ans=R*G*B

@njit
def calc(ans):
    for i in range(N-2):
        for j in range(i+1, N-1):
            if 0<=j+j-i<N:
                si=S[i]
                sj=S[j]
                sk=S[2*j-i]
                if si!=sj and sj!=sk and sk!=si:
                    ans-=1
    return ans
print(calc(ans))


### FIXED CODE ###

N=int(input())
S=input()
count=0
R=0
G=0
B=0
for i in range(N):
  if S[i]=="R":
    R+=1
  if S[i]=="G":
    G+=1
  if S[i]=="B":
    B+=1
count=0
for i in range(N-2):
  for j in range(i,N-1):
    k=j+j-i
    try:
      if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
        count+=1
    except:
      pass
    
print(R*G*B-count)
### BUGGY CODE ###

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

su = 0
N = int(input())
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            su += gcd(i,j,k)
print(su)

### FIXED CODE ###

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

su = 0
N = int(input())
for i in range(1,N+1):
    for j in range(i+1,N+1):
        for k in range(j+1,N+1):
            su += gcd(i,j,k)
su *= 6
for x in range(1,N+1):
    for y in range(1,N+1):
        if x != y:
            su += 3*(gcd(x,y))
        else:
            su += x
print(su)
### BUGGY CODE ###

k = int(input())
n = 0
frag = 0
sevens = ""
while frag==0:
    sevens = sevens + "7"
    n+=1
    if int(sevens)%k==0:
        frag=1
print(n)

### FIXED CODE ###

k = int(input())

x = 7

for i in range(k):
    if x%k==0:
        print(i+1)
        exit()
    x = (x*10 + 7)%k
print("-1")
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
for _ in range(q):
    l,r=map(int,input().split())
    x=s[l-1:r]
    v=len(x)
    y=x.replace("AC","")
    w=len(y)
    print((v-w)//2)


### FIXED CODE ###

n,q=map(int,input().split())
s=input()
list=[0]*(n+1)
cnt=0
for i in range(1,n):
    if s[i]=="C" and s[i-1]=="A":
        cnt+=1
        list[i+1]+=cnt
    else:
        list[i+1]+=cnt
for _ in range(q):
    l,r=map(int,input().split())
    print(list[r]-list[l])
### BUGGY CODE ###

import copy

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

AB = [[]] * N

for i in range(M):
    A, B = list(map(int, input().split()))
    tmp = copy.deepcopy(AB[A-1])
    tmp.append(B-1)
    AB[A-1] = tmp
    tmp = copy.deepcopy(AB[B-1])
    tmp.append(A-1)
    AB[B-1] = tmp

cnt = 0
for j in range(len(AB)):
    for val in AB[j]:
        if H[j] <= H[val]:
            break
    else:
        cnt += 1

print(cnt)


### FIXED CODE ###

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

result = [1] * N

for i in range(M):
    A, B = list(map(int, input().split()))
    if H[A-1] <= H[B-1]:
        result[A-1] = 0
    if H[B-1] <= H[A-1]:
        result[B-1] = 0

print(sum(result))
### BUGGY CODE ###

import math
from functools import reduce

def gcd(*num):
    return reduce(math.gcd, num)

N = int(input())

I = range(1, N+1)
J = range(1, N+1)
K = range(1, N+1)

combinations = [(i, j, k)
                for i in I
                for j in J
                for k in K]

count = 0

for i, j, k in combinations:
    count = count + gcd(i, j, k)

print(count)

### FIXED CODE ###

n = int(input())

from math import gcd

y = 0
for i in range(1, n + 1):
    for j in range(1, n + 1):
        x = gcd(i, j)
        for k in range(1, n + 1):
            y += gcd(x, k)

print(y)
### BUGGY CODE ###

from networkx import*
n, m = map(int, input().split())
edges = [tuple(map(int, input().split())) for _ in range(m)]
G = Graph()
G.add_nodes_from(range(1, n+1))
G.add_edges_from(edges)
ccs = connected_components(G)
ans = max(map(len, ccs))
print(ans)

### FIXED CODE ###

from networkx import*
_,*t=map(str.split,open(0))
print(max(1,1,*map(len,connected_components(Graph(t)))))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
Query = [list(map(int,input().split())) for _ in range(m)]
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)
for i in range(m):
    b,c = Query[i][0],Query[i][1]
    if A[0] >= c:
        break
    else:
        index = bisect.bisect_left(A,c)
        if b <= index:
            A = A[b:index] + [c for i in range(b)] + A[index:]
        else:
            A = [ c for i in range(index)] + A[index:]
print(sum(A))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

minA = A[0]
Query = []
for _ in range(m):
    b,c = map(int,input().split())
    if c > minA:
        Query.append([b,c])
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)

ans = 0
index = 0
for b,c in Query:
    if index >= n:
        break
    #print("----")
    cnt = 0
    Flag = True
    while Flag:
        #print(A,b,c,index)
        if A[index] < c:
            A[index] = c
            cnt += 1
            index += 1
            if (cnt >= b) or (index >= n):
                Flag = False
        else:
            Flag = False
    '''
    #A.sort()
    if A[0] >= c:
        break
    else:
        index = min(bisect.bisect_left(A,c),b)
        if index > len(A):
            ans += c * len(A)
            break
        else:
            ans += c * index
            A = A[index:]
    print(A)
    '''
print(sum(A))
### BUGGY CODE ###

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

# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = int(input())
    a = input_to_int_tuple()

    ret = 0
    for i in range(1, n + 1):
        ih = a[i - 1]
        for j in range(i + ih, n + 1):
            if (j - i) == (ih + a[j - 1]):
                ret += 1

    return ret


if __name__ == "__main__":
    print(main())


### FIXED CODE ###

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

# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = int(input())
    a = input_to_int_tuple()

    from collections import defaultdict
    l = defaultdict(int)
    r = defaultdict(int)
    for i, h in enumerate(a):
        no = i + 1
        l[no + h] += 1
        r[no - h] += 1

    ret = 0
    for i in range(1, n + 1):
        ret += (l.get(i, 0) * r.get(i, 0))

    return ret


if __name__ == "__main__":
    print(main())
### BUGGY CODE ###

import sys
def check(S, cnt, start_idx):
    if len(S) < 2:
        print(cnt)
        sys.exit()
    for i in range(start_idx, len(S) - 1):
        if S[i] != S[i + 1]:
            S = S[:i] + S[i + 2:]
            cnt += 2
            check(S, cnt, i - 1)
    print(cnt)
    sys.exit()

S = list(map(int, list(input())))
check(S, cnt=0, start_idx = 0)

### FIXED CODE ###

def main():
    S = list(map(int, list(input())))

    cnt1 = sum(S)
    cnt0 = len(S) - cnt1
    print(2 * min(cnt0, cnt1))


if __name__ == "__main__":
    main()
### BUGGY CODE ###

h,w = map(int,input().split())
c = []
for i in range(h):
  a = input()
  c.append(a)
  
from collections import deque

def bfs(sh,sw):
    d = [[False] * w for i in range(h)]

    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sh,sw,0))
    d[sh][sw] = True

    while que:
        p = que.popleft()
        if c[p[0]][p[1]] == '#':
            break
        for i in range(4):
            nw = p[1] + dx[i]
            nh = p[0] + dy[i]

            if 0 <= nw < w and 0 <= nh < h and d[nh][nw] == False:
                que.append((nh,nw,p[2]+1))
                d[nh][nw] = True
    return p[2]
  
ans = 0
for i in range(h):
  for j in range(w):
    res = bfs(i,j)
    ans = max(ans,res)
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

h,w = map(int,input().split())
c = []
for i in range(h):
  a = input()
  c.append(a)
  
from collections import deque

d = [[-1] * w for i in range(h)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

que = deque([])
for i in range(h):
  for j in range(w):
    if c[i][j] == '#':
      que.append((i,j,0))
      d[i][j] = 0

ans = 0
while que:
  p = que.popleft()
  for i in range(4):
      nw = p[1] + dx[i]
      nh = p[0] + dy[i]
      if 0 <= nw < w and 0 <= nh < h and d[nh][nw]==-1:
          que.append((nh,nw,p[2]+1))
          d[nh][nw] = p[2]+1
          ans = max(ans,p[2]+1)

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import numpy as np
H,W = map(int,input().split())
HL=range(H)
WL=range(W)
Gd = [list(input()) for _ in HL]
L=[np.arange(1, W+1)]*H
R=[np.arange(W, 0, -1)]*H
U=[np.arange(H, 0, -1)]*W
D=[np.arange(1, H+1)]*W
L=np.array(L)
R=np.array(R)
U=np.array(U)
D=np.array(D)
def ma():
  for h in HL:
    for w in WL:
      if Gd[h][w]=='#':
        L[h][w:]=L[h][w:]-L[h][w]
      wr=W-w-1
      if Gd[h][wr]=='#':
        R[h][:wr+1]=R[h][:wr+1]-R[h][wr]
  for w in WL:
    for h in HL:
      if Gd[h][w]=='#':
        D[w][h:]=D[w][h:]-D[w][h]
      hr=H-h-1
      if Gd[hr][w]=='#':
        U[w][:hr+1]=U[w][:hr+1]-U[w][hr]
  return np.max(D.T+U.T+L+R-3)
print(ma())

### FIXED CODE ###

import numpy as np
H,W = map(int,input().split())
HL=list(range(H))
WL=list(range(W))
Gd = np.array([list(input()) for _ in HL])
Gd = np.where(Gd=='.', 1, 0)
L=np.zeros((H,W),dtype=np.int64)
R=np.zeros((H,W),dtype=np.int64)
U=np.zeros((H,W),dtype=np.int64)
D=np.zeros((H,W),dtype=np.int64)

for w in WL:
  R[:,w]=(R[:,w-1]+1)*Gd[:,w]
  L[:,-w-1]=(L[:,-w]+1)*Gd[:,-w-1]
for h in HL:
  D[h,:]=(D[h-1,:]+1)*Gd[h,:]
  U[-h-1,:]=(U[-h,:]+1)*Gd[-h-1,:]
print(np.max(D+U+L+R-3))
### BUGGY CODE ###

n = int(input())
pre_i = -1
pre_j = -1
for i in range(1,n+1):
  if n%i == 0:
    j = int(n/i)
    if j == pre_i and i == pre_j:
      break
    pre_i = i
    pre_j = j
print (i+j-2)


### FIXED CODE ###

import math
n = int(input())
mini = 1000000000000000
for i in range(1, math.ceil(math.sqrt(n))+1):
  if n % i == 0 and ((n/i + i) - 2) < mini:
    mini = ((n/i + i) - 2)
print(int(mini))
### BUGGY CODE ###

n, m = map(int, input().split())
des = []
first = []
second = []
a = 1
for i in range(0, m):
	b = (list(map(int, input().split())))
	if b[0] == 1:
		first.append(b[1])
		if b[1] in second:
			print('POSSIBLE')
			a = 0
			break
	if b[1] == n:
		second.append(b[0])
		if b[0] in first:
			print('POSSIBLE')
			a = 0
			break
		
if a:
	print('IMPOSSIBLE')





### FIXED CODE ###

n, m = map(int, input().split())
des= [0]*(n+1)
a = 1
for i in range(0, m):
	b = (list(map(int, input().split())))
	if b[0] == 1:
		des[b[1]] += 1
		if des[b[1]] == 2:
			print('POSSIBLE')
			a = 0
			break
	if b[1] == n:
		des[b[0]] += 1
		if des[b[0]] == 2:
			print('POSSIBLE')
			a = 0
			break
		
if a:
	print('IMPOSSIBLE')
### BUGGY CODE ###

A,V=map(int, input().split())
B,W=map(int, input().split())
T = int(input())
k = abs(A-B)
d = V-W
if d <= 0:
  print("NO")
else:
  for i in range(T):
    k -= d
    if k <= 0:
      print("YES")
      break
  else:
    print("NO")


### FIXED CODE ###

A,V=map(int, input().split())
B,W=map(int, input().split())
T = int(input())
k = abs(A-B)
d = V-W
if d <= 0:
  print("NO")
else:
  if (k / d) > T:
    print("NO")
  else:
    print("YES")
### BUGGY CODE ###

from collections import Counter

n,m,q  = map(int,input().split())
rails=[tuple(map(int,input().split())) for i in range(m)]
qs=[tuple(map(int,input().split())) for i in range(q)]

sumlist = [[0 for j in range(n+1)] for i in range(n)]
for (l,r),i in Counter(rails).items():
    for j in range(r,n+1):
        sumlist[l-1][j] += i


for (p,q) in qs:
    ans = 0
    for i in range(p-1,q):
        ans = ans+sumlist[i][q]-sumlist[i][p-1]
    print(ans)


### FIXED CODE ###

from collections import Counter
from itertools import product

n,m,q  = map(int,input().split())
rails=[tuple(map(int,input().split())) for i in range(m)]
qs=[tuple(map(int,input().split())) for i in range(q)]

xlist = [[0 for j in range(n)] for i in range(n)]
sumlist = [[0 for j in range(n+1)] for i in range(n)]
for (l,r),i in Counter(rails).items():
    xlist[l-1][r-1]=i


for (i,j) in product(range(n),range(n)):
    sumlist[i][j+1]=sum(xlist[i][0:j+1])


for (p,q) in qs:
    ans = 0
    for i in range(p-1,q):
        ans = ans+sumlist[i][q]-sumlist[i][p-1]
    print(ans)
### BUGGY CODE ###

K = input()
K = int(K)

def seven():
    seven_i = 0
    SEVEN = list()
    count = 0
    for i in range(K):
        seven_i += (10**i*7)
        SEVEN.append(seven_i)
        count += 1
        if SEVEN[i] % K == 0:
            return count
    return -1

print(seven())

    


### FIXED CODE ###

K = input()
K = int(K)

def seven():
    seven_i = 0
    count = 0
    for i in range(K):
        seven_i = ((10*seven_i) + 7) % K
        count += 1
        if seven_i % K == 0:
            return count
    return -1

print(seven())
### BUGGY CODE ###

import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n=I()
s=input()
r=[]
g=[]
t=[]
for i in range(n):
    if s[i:i+1]=="R":
        r.append(i)
    elif s[i:i+1]=="G":
        g.append(i)
    else:
        t.append(i)
R=len(r)
G=len(g)
T=n-R-G
ans=R*G*T
for i in range(n-1):
    for j in range(i+1,n):
        if s[i]!=s[j]:
            if j<2*i-j<=n-1:
                if s[i]!=s[2*i-j] and s[j]!=s[2*i-j]:
                    ans-=1
            if j<2*j-i<=n-1:
                if s[i]!=s[2*j-i] and s[j]!=s[2*j-i]:
                    ans-=1
            if (i+j)%2==0 and j<(i+j)//2 and s[i]!=s[(i+j)//2] and s[j]!=s[(i+j)//2]:
                ans-=1
print(ans)

### FIXED CODE ###

import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n=I()
s=input()
r=[]
g=[]
t=[]
for i in range(n):
    if s[i:i+1]=="R":
        r.append(i)
    elif s[i:i+1]=="G":
        g.append(i)
    else:
        t.append(i)
R=len(r)
G=len(g)
T=n-R-G
ans=R*G*T
for i in range(n-1):
    for j in range(i+1,n):
        if s[i]!=s[j]:
            if j<2*i-j<=n-1:
                if s[i]!=s[2*i-j] and s[j]!=s[2*i-j]:
                    ans-=1
            if j<2*j-i<=n-1:
                if s[i]!=s[2*j-i] and s[j]!=s[2*j-i]:
                    ans-=1
            if (i+j)%2==0 and j<(i+j)//2 and s[i]!=s[(i+j)//2] and s[j]!=s[(i+j)//2]:
                ans-=1
print(ans)