Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python3

from itertools import product

def get_label(labels, target):
    if labels[target] == -1:
        return target
    return get_label(labels, labels[target])


def main():
    n, m = list(map(int, input().split()))
    a = []
    b = []
    for _ in range(m):
        ai, bi = list(map(int, input().split()))
        a.append(ai-1)
        b.append(bi-1)

    # 不便さのMAX
    result = [n * (n-1) // 2]
    labels = [-1] * n
    groups = {}
    for i in range(n):
        groups[i] = {i}


    for j in range(m):
        i = m - 1 - j
        ai = a[i]
        bi = b[i]
        label_a = get_label(labels, ai)
        label_b = get_label(labels, bi)
        if label_a != label_b:
            next_val = result[-1]
            next_val -= len(groups[label_a]) * len(groups[label_b])
            result.append(next_val)
            groups[label_a] |= groups[label_b]
            labels[label_b] = label_a
            del groups[label_b]
        else:
            result.append(result[-1])

    result.reverse()
    for v in result[1:]:
        print(v)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3

from itertools import product
import sys
sys.setrecursionlimit(100000)

def get_label(labels, target):
    if labels[target] == -1:
        return target
    else:
        temp = get_label(labels, labels[target])
        labels[target] = temp
        return temp


def main():
    n, m = list(map(int, input().split()))
    a = []
    b = []
    for _ in range(m):
        ai, bi = list(map(int, input().split()))
        a.append(ai-1)
        b.append(bi-1)

    # 不便さのMAX
    result = [n * (n-1) // 2]
    labels = [-1] * n
    groups = {}
    for i in range(n):
        groups[i] = 1

    for j in range(m):
        i = m - 1 - j
        ai = a[i]
        bi = b[i]
        label_a = get_label(labels, ai)
        label_b = get_label(labels, bi)
        if label_a != label_b:
            next_val = result[-1]
            next_val -= groups[label_a] * groups[label_b]
            result.append(next_val)
            groups[label_a] += groups[label_b]
            labels[label_b] = label_a
            del groups[label_b]
        else:
            result.append(result[-1])

    result.reverse()
    for v in result[1:]:
        print(v)

if __name__ == '__main__':
    main()
import sys
import math

N = input()

if int(N) <= 100:
    print("0")
    sys.exit()

if int(N) % 100 == 0:
    print("1")
    sys.exit()

tmp = (int(N) - (int(N)//100)*100)

if tmp <= 5:
    print("1")
    sys.exit()

tmp2 = math.ceil(tmp/5)

if int(N) <= tmp2*105:
    print("0")
else:
    print("1")


### FIXED CODE ###

M1,D1= map(int, input().split())
M2,D2 = map(int, input().split())

if D1 + 1 == D2:
    print(0)
else:
    print(1)
n = int(input())
s = input()
ans = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    if s[i] != s[j]:
    for k in range(j+1, n):
      if s[j] != s[k] and s[k]!= s[i]:
        if j-i != k-j:
          ans +=1
print(ans)

### FIXED CODE ###

import statistics as st
n = int(input())
s = input()
NGs = 0
r = set()
g = set()
b = set()
for i in range(n):
  if s[i] == "R":
    r.add(i)
  elif s[i] == "G":
    g.add(i)
  else:
    b.add(i)
for i in range(n-2):
  for d in range((n-i-1)//2+1):
    j = i+d
    k = j+d
    if i in r and j in g and k in b:
      NGs += 1
    elif i in r and j in b and k in g:
      NGs += 1
    elif i in g and j in r and k in b:
      NGs += 1
    elif i in g and j in b and k in r:
      NGs += 1
    elif i in b and j in r and k in g:
      NGs += 1
    elif i in b and j in g and k in r:
      NGs += 1
print(len(r)*len(g)*len(b)-NGs)
i = 1
while True:
  if raw_input() == '0':
    break
  pritn 'Case {number}: {input}'.format(number=i, input=raw_input())
  i += 1

### FIXED CODE ###

i = 1
while True:
  x = raw_input()
  if x == '0':
    break
  print 'Case {0}: {1}'.format(i, x)
  i += 1
b = input()
if b == 'A':
    print(T)
elif b == 'T':
    print(A)
elif b == 'C':
    print(G)
else:
    print(C)


### FIXED CODE ###

b = input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')
n = int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(a[-1] - a[0])

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(a[-1] - a[0])
import math


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


N = int(input())
T = [int(input()) for _ in range(N)]
tmp = 1
for i in range(N):
    tmp = lcm(tmp, T[i])
print(tmp)


### FIXED CODE ###

import fractions


def lcm(a, b):
    n = fractions.gcd(a, b)
    return a * b // n if n > 0 else 0


N = int(input())
T = [int(input()) for _ in range(N)]
tmp = 1
for i in range(N):
    tmp = lcm(tmp, T[i])
print(tmp)
s = input()

flag = True
for i in range(N-1):
  if s[i] == s[i+1]:
    print("Bad")
	flag = False

if flag:
  	print("Good")

### FIXED CODE ###

s = input()

flag = True
for i in range(len(s)-1):
  if s[i] == s[i+1]:
    print("Bad")
    flag = False
    break
if flag:
  print("Good")
# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

h.sort()
tmp = 0
for i in range(n-k, n):
    tmp += h[i]
if k >= n:
    ans = 0
else:
    ans = (sum(h) - tmp)
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
n, k = map(int,input().split())
h = [int(i) for i in input().split()]

if k >= n:
    ans = 0
else:
    h.sort()
    tmp = 0
    for i in range(n-k, n):
        tmp += h[i]
    ans = (sum(h) - tmp)
print(ans)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
n=int(0)
manzoku=int(0)
hantei = int(1)
if A[0] == hantei:
        manzoku += sum(C) + sum(B)
else:
        manzoku += sum(C) - C[A[0]-3] +sum(B)

print(manzoku)


### FIXED CODE ###

N=int(input())
print(N*N*N)
s=input()
S=[]
for i in range(s):
    S.append(s[i])
d=[]
for i in range(len(S)-2):
    N=int(S[i:i+3])
    d.append(abs(N-753))
print(min(d))

### FIXED CODE ###

S=input()
d=[]
for i in range(len(S)-2):
    N=int(S[i:i+3])
    d.append(abs(N-753))
print(min(d))
a, b, c, d, e, f = map(int, input().split())

water = set()
for i in range(f//(a*100)+1):
    for j in range(f//(b*100)+1):
        k = 100*(i*a+j*b)
        if k == 0:
            continue
        if k <= f:
            water.add(k)
        else:
            break

water = list(water)
water.sort()

suger = set()
for i in range(water[-1]*e//(100*c)+1):
    for j in range(water[-1]*e//(100*d)+1):
        k = i*c+j*d
        if k <= f:
            suger.add(k)
        else:
            break

suger = list(suger)
suger.sort()


weight_water, weight_suger = 0, 0
ratio = 0
n = len(suger)
for w in water:
    if w == 0:
        continue
    bit_l, bit_r = 0, n
    while bit_r - bit_l > 1:
        key = (bit_r+bit_l)//2
        s = suger[key]
        if s+w <= f and s*100 <= e*w:
            bit_l = key
        else:
            bit_r = key
    if bit_l == n-1 and (suger[bit_l]/(suger[bit_l]+w) > e or suger[bit_l]+w > f):
        continue
    if bit_l == 0 and suger[1]/(suger[1]+w) <= e and suger[1]+w <= f:
        ws = suger[1]
    else:
        ws = suger[bit_l]
    if ratio*w < ws*100 <= e*w:
        ratio = ws*100/w
        weight_water, weight_suger = w+ws, ws
print(weight_water, weight_suger) 

### FIXED CODE ###

a, b, c, d, e, f = map(int, input().split())

water = [False]*(f+1)
suger = [False]*(f+1)

for i in range(0, f+1, a*100):
  water[i] = True
for i in range(f+1):
  if (i == 0 or water[i]) and i+b*100 <= f:
    water[i+b*100] = True
  
for i in range(0, f+1, c):
  suger[i] = True
for i in range(f+1):
  if (i == 0 or suger[i]) and i+d <= f:
    suger[i+d] = True

ans_w, ans_s = a*100, 0
for i in range(f+1):
  if water[i] == False:
    continue
  for j in range(f, -1, -1):
    if suger[j] == False or j*(100+e) > (j+i)*e or j+i > f:
      continue
    if j*(ans_w+ans_s) > (j+i)*ans_s:
      ans_w, ans_s = i, j
    break
print(ans_w+ans_s, ans_s)
# -*- coding: utf-8 -*-
from math import factorial
N = int(input())
# スペース区切りの整数の入力
a = []
for i in range(N):
  a.append(input())

b = []
for s in a:
  temp = list(s)
  temp.sort()
  b.append("".join(temp))

count = 0
for s in set(b):
  temp = b.count(s)
  if temp >= 2:
    count += factorial(temp) / factorial(2) / factorial(temp - 2)

print(int(count))

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
dic = {}
count = 0
for i in range(N):
  temp = "".join(sorted(input()))
  if temp in dic:
    count += dic[temp]
    dic[temp] += 1
  else:
    dic[temp] = 1

print(count)
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>=0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
  
  f+=c[e]
  f+=c[e-1]

  print(f)



### FIXED CODE ###

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

if N - K < 0:
  print(0)
else:
  print(sum(H[:N-K]))
# coding: utf-8

import sys
input = sys.stdin.readline

# N = int(input())
N, K = map(int, input().split())
D = [int(x) for x in input().split()]
# S = input()

ans = 0
for l in range(N + 1):
    if l > K:
        break

    for r in range(N - l + 1):
        if l + r > K:
            break

        value_list = D[0 : l] + D[N - r : N]
        sort(value_list)
        
        for i in range(K - (l + r) + 1):
            ans = max(ans, sum(value_list[i:]))
        
print(ans)


### FIXED CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline

# N = int(input())
N, K = map(int, input().split())
D = [int(x) for x in input().split()]
# S = input()

ans = 0
for l in range(N + 1):
    if l > K:
        break

    for r in range(N - l + 1):
        if l + r > K:
            break

        value_list = D[0 : l] + D[N - r : N]
        value_list.sort()
        
        for i in range(K - (l + r) + 1):
            ans = max(ans, sum(value_list[i:]))
        
print(ans)
a = input()
b = input()

if  a > b :
print("a > b")
if  a < b :
print("a < b")
if  a == b :
print("a == b")

### FIXED CODE ###

a,b=map(int,raw_input().split())
if a > b:
    print 'a > b'
elif a < b:
    print 'a < b'
else:
    print 'a == b'
import math

T = int(input())
for i in range(T):
    a, b, c, d = map(int, input().split())

    if a < b:
        print("No")
        continue

    if b > d:
        print("No")
        continue

    if c >= b: # d >= b
        print("Yes")
        continue

    diff = d % b
    if diff == 0:
        if a % b <= c:
            print("Yes")
            continue
        else:
            print("No")
            continue

    gcd = math.gcd(b, diff)

    init_mod = c % b

    base_mod = init_mod % gcd
    if b + base_mod - gcd > c:
        print("No")
    else:
        print("Yes")


### FIXED CODE ###

import sys

sys.setrecursionlimit(100000)

def gcd(a, b):
    r = a % b
    if r == 0:
        return b
    else:
        return gcd(b, r)

T = int(input())
for i in range(T):
    a, b, c, d = list(map(int, input().split()))

    if a < b:
        print("No")
        continue

    if b > d:
        print("No")
        continue

    if c >= b: # d >= b
        print("Yes")
        continue

    diff = d % b
    if diff == 0:
        if a % b <= c:
            print("Yes")
            continue
        else:
            print("No")
            continue

    g = gcd(b, diff)

    init_mod = c % b

    base_mod = init_mod % g
    if b + base_mod - g > c:
        print("No")
    else:
        print("Yes")
N = int(input())

H_ls = list(map(int,input().split("")))

h_left = H_ls[0]-1

ans = "Yes"
for h in H_ls:
    if h_left < h:
        h-=1:
    elif h_left > h:
        ans = 'No'
        break:
    h_left = h

print(ans)


### FIXED CODE ###

N = int(input())

H_ls = list(map(int,input().split(" ")))

h_left = H_ls[0]-1

ans = "Yes"
for h in H_ls:
    if h_left < h:
        h-=1
    elif h_left > h:
        ans = 'No'
        break
    h_left = h

print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[1], A[0])
if N >= 2:
    for a in A[2:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[0], A[0])
if N > 1:
    for a in A[1:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)
from collections import deque

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


noz=[x-a for x in cards].count(0)
pl=[x-a for x in cards if x-a>0]
nl=[a-x for x in cards if x-a<0]
sl=[pl,nl][len(nl)<=len(pl)]
ll=[pl,nl][len(pl)<len(nl)]

sl.sort()
ll.sort()

sumfunc = lambda n, l: sum([l[x]*((n>>x)&1) for x in range(len(l))])

ssl=sum(sl)
sll=sum(ll)
sumsl=[0 for _ in range(ssl)]
sumll=[0 for _ in range(sll)]
sumsl[sl[-1]-1]=1
sumll[ll[-1]-1]=1
for i in range(1,2**(len(sl)-1)):
    s=sumfunc(i,sl)
    sumsl[s-1]+=1
    sumsl[s+sl[-1]-1]+=1
for i in range(1,2**(len(ll)-1)):
    s=sumfunc(i,ll)
    sumll[s-1]+=1
    sumll[s+ll[-1]-1]+=1
count=sum([x*y for x,y in zip(sumsl, sumll)])
# count=0
# p=sum([not sumsl[-1]<sumfunc(2**i,ll) for i in range(1,len(ll)+1)])
# q=sum([sumsl[0]>=sumfunc(2**i-1,ll) for i in range(1,len(ll)+1)])
# count=[sumfunc(j,ll) in sumsl for j in range(2**q-1,2**p)].count(True)

print((count+1)*(2**noz)-1)


### FIXED CODE ###

import sys

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

integers=[x-a for x in cards]
cards.append(a)
f=max(cards)*n


dp=[[0 for i in range(n+1)] for j in range(2*f+1) ]

for y in range(n+1):
    for x in range(2*f+1):
        if y==0 and x==f:
            dp[x][y]=1
        elif y>0 and (x-integers[y-1]<0 or x-integers[y-1]>2*f):
            dp[x][y]=dp[x][y-1]
        elif y>0 and x-integers[y-1]>=0 and x-integers[y-1]<=2*f:
            dp[x][y]=dp[x-integers[y-1]][y-1]+dp[x][y-1]
        else:
            dp[x][y]=0
print(dp[f][n]-1)
n = input()
l = []
l += [str(n) + ":"]
while 1:
    if n == 1:break
    for i in count(2):
        if n % i == 0:
            n /= i
            l += [i]
            break
print " ".join(map(str,l))

### FIXED CODE ###

n = input()
l = []
l += [str(n)+":"]
i = 2
while i * i <= n:
    while n % i == 0:
        l += [i]
        n /= i
    i += 1
if n > 1: l += [n]
print " ".join(map(str,l))
r=int(input())
print("{:0.6f} {:0.6f}".format(r**2*3.14159265,r*2*3.14159265))

### FIXED CODE ###

import math
r=float(input())
print("{:0.6f} {:0.6f}".format(r**2*math.pi,r*2*math.pi))
def lin(t,i):
    return As[i]*t+Bs[i]
f=input().split(" ")
n,t=int(f[0]),int(f[1])
As=[]
Bs=[]
for i in range(n):
    f=input().split(" ")
    As.append(int(f[0]))
    Bs.append(int(f[1]))
time=0
count=0
shop_list=list(range(n))
while len(shop_list)>0:
    test=min(enumerate([lin(time+1,i) for i in shop_list]), key = lambda x:x[1])
    next_time,shop=test[1],shop_list[test[0]]
    if time+1+next_time>t:
        break
    else:
        time=time+1+next_time
        shop_list.remove(shop)
        count+=1
print(count)

### FIXED CODE ###

s=input()
while True:
  if len(s)==0:
    print("Yes")
    break
  elif len(s)==1:
    print("No")
    break
  elif s[:2]=="hi":
    s=s[2:]
  else:
    print("No")
    break
from itertools import permutations
n=int(input())
p,q = = tuple(map(int, input().split())), tuple(map(int, input().split()))
l = list(range(1,n+1))
x = [i for i in permutations(l,n)]
print(abs(x.index(p) - x.index(q)))

### FIXED CODE ###

from itertools import permutations
n=int(input())
p,q = tuple(map(int, input().split())), tuple(map(int, input().split()))
l = list(range(1,n+1))
x = [i for i in permutations(l,n)]
print(abs(x.index(p) - x.index(q)))
n = int(input())
arr = [0]*10100
for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            s = i*i+j*j+k*k+i*j+j*k+k*i;
            if s<10100:
                ans[s]+=1
for i in range(n):
    print(arr[i+1])

### FIXED CODE ###

n = int(input())
arr = [0]*10100
for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            s = i*i+j*j+k*k+i*j+j*k+k*i;
            if s<10100:
                arr[s]+=1
for i in range(n):
    print(arr[i+1])
N, M = map(int, input().split())
listA = list(map(int, input().split()))
c = [0,2,5,5,4,5,6,3,7,6]
dp = [-1]*N
dp[0] = 0
for j in range(1, N+1):
	for a in listA:
		if j-c[a] >= 0:
			dp[j] = max(dp[j], dp[j-c[a]]*10+a)
print(dp[N])

### FIXED CODE ###

N, M = map(int, input().split())
listA = list(map(int, input().split()))
c = [0,2,5,5,4,5,6,3,7,6]
dp = [-1]*10010
dp[0] = 0
for j in range(1, N+1):
	for a in listA:
		if j-c[a] >= 0:
			dp[j] = max(dp[j], dp[j-c[a]]*10+a)
print(dp[N])
def f():
  for i in a[1:]:
    if c > 0:
      if c + i >= 0:
        cost += c + i + 1
        c = -1
      else:
        c += i
    else:
      if c + i <= 0:
        cost += 1 - c - i
        c = 1
      else:
        c += i


n = int(input())
a = list(map(int, input().split()))
cost = (a[0] == 0)
c = a[0] + (a[0] == 0)
f()
tmp = cost
cost = 0
if a[0] >= 0:
  cost = a[0] + 1
  c = -1
else:
  cost = -a[0] + 1
  c = 1
f()
print(min(cost, tmp))


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
cost = (a[0] == 0)
c = a[0] + (a[0] == 0)
for i in a[1:]:
	if c > 0:
		if c + i >= 0:
			cost += c + i + 1
			c = -1
		else:
			c += i
	else:
		if c + i <= 0:
			cost += 1 - c - i
			c = 1
		else:
			c += i
tmp = cost
cost = 0
if a[0] >= 0:
	cost = a[0] + 1
	c = -1
else:
	cost = -a[0] + 1
	c = 1
for i in a[1:]:
	if c > 0:
		if c + i >= 0:
			cost += c + i + 1
			c = -1
		else:
			c += i
	else:
		if c + i <= 0:
			cost += 1 - c - i
			c = 1
		else:
			c += i
print(int(min(tmp, cost)))
n, x, m = map(int,input().split())
ans = x
num = 0
l = [0]*min(m,10**4)
lis = [-1]*min(m,10**4)
l[0] = x
lis[x] = num
for i in range(1,n):
    x = (x*x)%m
    num += 1
    if lis[x]!=-1:
        a = (n-i)//(i-lis[x])
        b = (n-i)%(i-lis[x])
        ans += a * sum(l[lis[x]:i])
        break
    l[i] = x
    lis[x] = i
    ans += x
for i in range(lis[x],lis[x]+b):
    ans += l[i]
print(ans)

### FIXED CODE ###

n, x, m = map(int,input().split())
ans = x
num = 0
l = [0]*m
lis = [-1]*m
l[0] = x
lis[x] = num
for i in range(1,n):
    x = (x*x)%m
    num += 1
    if lis[x]!=-1:
        a = (n-i)//(i-lis[x])
        b = (n-i)%(i-lis[x])
        ans += a * sum(l[lis[x]:i])
        for j in range(lis[x],lis[x]+b):
            ans += l[j]
        break
    l[i] = x
    lis[x] = i
    ans += x
print(ans)
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans, min = 0, 1e9
for i in range(N):
  if abs((T-H[i]*0.006) - A) < m:
    ans = i
    m = abs((T-H[i]*0.006) - A)
print(i)

### FIXED CODE ###

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans, m = 0, 1e9
for i in range(N):
  if abs((T-H[i]*0.006) - A) < m:
    ans = i+1
    m = abs((T-H[i]*0.006) - A)
print(ans)
#b.py
n = int(input())
lis = list(map(int,input()))
ans = 0
for x,y,z in zip(lis,lis[1:],lis[2:]):
    if x < y < z:
        ans += 1
print(ans)

### FIXED CODE ###

#b.py
n = int(input())
lis = list(map(int,input().split()))
ans = 0
for x,y,z in zip(lis,lis[1:],lis[2:]):
    if x < y < z or z < y < x:
        ans += 1
print(ans)
import numpy as np
a,b,c = map(int,input().split())
if np.sqrt(c) - np.sqrt(a) - np.sqrt(b) > 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

k = int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])
print(A+B/24)

### FIXED CODE ###

import sys
a = sys.stdin.readline()
a,b = a.strip().split(" ")
print((int(a)+int(b))%24)
n=input()
if n%2==0:
    print(n/2)
else:
    print((n//2)+1)

### FIXED CODE ###

n=int(input())
if n%2==0:
    print(int(n/2))
else:
    print((n//2)+1)
N,M,K = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
subseqA = [0] # i th element is sum of first i books
subseqB = [0]
for elem in a:
    subseqA.append(subseqA[-1]+elem)
for elem in b:
    subseqB.append(subseqB[-1]+elem)
maxBooks = 0
curABooks = 0
curBBooks = 0
for i in range(N+1):
    if K < subseqA[i]:
        curABooks = i - 1
        maxBooks = i - 1
        break
for i in range(curABooks,-1,-1):
    for j in range(curBBooks + 1,M+1):
        if subseqA[i] + subseqB[j] > K:
            curBBooks = j - 1
            break
    if subseq[i] + subseqB[M] > K:
        curBBooks = M
    if i + curBBooks > maxBooks:
        maxBooks = i + curBBooks
print(maxBooks)

### FIXED CODE ###

N,M,K = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
subseqA = [0] # i th element is sum of first i books
subseqB = [0]
for elem in a:
    subseqA.append(subseqA[-1]+elem)
for elem in b:
    subseqB.append(subseqB[-1]+elem)
maxBooks = 0
curABooks = 0
curBBooks = 0
for i in range(N+1):
    if K < subseqA[i]:
        curABooks = i - 1
        maxBooks = i - 1
        break
if subseqA[N] <= K:
    curABooks = N
for i in range(curABooks,-1,-1):
    for j in range(curBBooks + 1,M+1):
        if subseqA[i] + subseqB[j] > K:
            curBBooks = j - 1
            break
    if subseqA[i] + subseqB[M] <= K:
        curBBooks = M
    if i + curBBooks > maxBooks:
        maxBooks = i + curBBooks
print(maxBooks)
s = input()

posA = 0
posZ = 0

for i in range(len(s)):
  if s[i] == "A":
    posA = i
    break
for j in range(len(s)):
  if s[-j-1] == "Z":
    posZ = N - 1 - j
    break

print(posZ - posA + 1)

### FIXED CODE ###

s = input()
 
posA = 0
posZ = 0
 
for i in range(len(s)):
  if s[i] == "A":
    posA = i
    break
for j in range(len(s)):
  if s[-j-1] == "Z":
    posZ = len(s) - 1 - j
    break
 
print(posZ - posA + 1)
def probB():
    S = input()
    T = input()

    maxequal = 0
    for i in range(len(S) - len(T)):
        count = 0
        for j in range(len(T)):
            if S[i + j] == T[j]:
                count += 1
            if (count > maxequal):
                maxequal = count
    print(len(T) - maxequal if maxequal > 0 else 0)


def main():
    probB()


if __name__ == '__main__':
    main()


### FIXED CODE ###

def probA():
    D, T, S = map(int, input().split())

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


def main():
    probA()


if __name__ == '__main__':
    main()
N,K=map(int,input().split())
S=input()
tmp=list(S)
tmp[K]=tmp[K].lower()
print(tmp)

### FIXED CODE ###

N,K=map(int,input().split())
S=input()
tmp=list(S)
tmp[K-1]=tmp[K-1].lower()
print("".join(tmp))
Z = input().split()
A = int(Z[0])
B = Z[1].split('.')
B = int(B[0] + B[1])
#print(A*B)
a = str(A*B/100)[:-3]
a = int(a)
print(a)


### FIXED CODE ###

Z = input().split()
A = int(Z[0])
B = Z[1].split('.')
B = int(B[0] + B[1])
#print(A*B)
if len(str(A*B)) <= 2:
  a = 0
else:
  a = str(A*B)[:-2]
  a = int(a)
print(a)
331import math
l1=list(map(int,input().split()))
a=math.prod(l1)
if a>10**18:
  print("-1")
else:
  print(a)

### FIXED CODE ###


n=int(input())
l1=list(map(int,input().split()))
p=1
k=0
if 0 in l1:
  print("0")
  exit()
for i in range(n):
  p*=l1[i]
  if p>10**18:
    k=1
    break
if k==1:
  print("-1")
else:
  print(p)
A,B=input().split()
C=A*B
print(C)

### FIXED CODE ###

A,B=input().split()
C=int(A)*int(B)
print(C)