Harryxun/stf_run huggingface dataset:
N_s = input()
N = int(N_s)
ans = 0
for i in range(1, len(N_s)):
	if i % 2 == 1:
    	ans += (10**i - 10**(i - 1))
if len(N_s) % 2 == 1:
  	ans += (1 - 10**(len(N_s)) + N)
print(ans)


### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(1, n + 1):
  if len(str(i)) % 2 == 1:
    cnt +=1
print(cnt)
X = int(input())
k = list(range(0,X))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()

### FIXED CODE ###

X = int(input())
k = list(range(0,100000))
k5 = []
for i in k:
    k5.append(i**5)
for j in k5:
    if X + j in k5:
        print(k[k5.index(X+j)],k[k5.index(j)])
        exit()
    elif X - j in k5:
        print(k[k5.index(X-j)],-k[k5.index(j)])
        exit()
b=input()
if b = "A":
  print("T")
elif b = "G":
  print("C")
elif b = "T":
  print("A")
elif b = "C":
  print("G")

### FIXED CODE ###

b=input()
if b == "A":
  print("T")
elif b == "G":
  print("C")
elif b == "T":
  print("A")
elif b == "C":
  print("G")
#!/usr/bin/env python3

a = int(input())
p = [int(input()) for _ in range(p)]

print(sum(p)-max(p)+max(p)//2)


### FIXED CODE ###

#!/usr/bin/env python3

a = int(input())
p = [int(input()) for _ in range(a)]

print(sum(p)-max(p)+max(p)//2)
a = int(input())

b = []

for i in range(a):
    b.append((input().split()))

res = 0

for i in b:
    if (i[1] == 'BTC'):
        res += i[0]*380000
    else:
        res += i[0]

print(res) 

### FIXED CODE ###

a = int(input())

b = []

for i in range(a):
    b.append(input().split())

res = 0

for i in b:
    if (i[1] == 'BTC'):
        res += float(i[0])*380000
    else:
        res += int(i[0])

print(res)
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(k-1):
  if a[k+i]>a[i]:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
  if a[k+i]>a[i]:
    print("Yes")
  else:
    print("No")
a, b, k = map(int, input().split())
for i in range(a, min(b,a+k)):
  print(i)
for j in range(max(i,b-k)+1, b+1):
  print(j)

### FIXED CODE ###

a, b, k = map(int, input().split())
if a != b:
  if k == 0:
    print(a, b, sep='\n')
    exit()
else:
  print(a)
  exit()
for i in range(a, min(b,a+k)):
  print(i)
for j in range(max(i,b-k)+1,b+1):
  print(j)
n=int(input())
k=int(input())
i=0
while i < n && 2**i<=k:
    i+=1
print(2**i+k*(n-i))


### FIXED CODE ###

n=int(input())
k=int(input())
i=0
while i < n and 2**i<=k:
    i+=1
print(2**i+k*(n-i))
import numpy as np
from scipy.signal import convolve

n, k = map(int, input().split())
P = np.array(input().split(), dtype=int)
template = np.ones(k)

a = convolve(P, template, mode="valid", method="fft")

print((max(a) + k) / 2)

### FIXED CODE ###

import numpy as np
from scipy.signal import fftconvolve

n, k = map(int, input().split())
P = np.array(input().split(), dtype=int)
template = np.ones(k)

a = fftconvolve(P, template, mode="valid")

print((max(a) + k) / 2)
s1 = list(map(str, input().split()))
s2 = list(map(str, input().split()))
ans = 0
for i in range(3):
  if s1[i] == s2[i]:
    ans += 1
print(ans)

### FIXED CODE ###

x = input()
y = input()
ans = 0
for i in range(len(x)):
  for j in range(len(y)):
    if i == j:
      if x[i] == y[j]:
        ans += 1
print(ans)
n = input()
x = 1
ans = ''
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     ans = ans + x
  x += 1
print ans

### FIXED CODE ###

n = input()
ans = '' 
for i in range(3,n+1):
    if i%3 == 0 or '3' in str(i):
        ans += ' ' + str(i)
print ans
import numpy as np

Xin, Yin = input().split()

X = int(Xin)
Y = int(Yin)

a = np.array([[1, 1], [2, 4]])
b = np.array([X, Y])

result = np.linalg.solve(a, b)

if result[0].is_integer() and result[0] >= 0:
    if result[1].is_integer() and result[1] >= 0:
      print('Yes')
    else:
      print('No')
else:
  print('No')

### FIXED CODE ###

data = input().split()

count = 0
for num in data:
    num2 = int(num)
    if num2 == 0:
        result = count
    count += 1

result += 1

print(result)
N, M, K = map(int, input().split())
 
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
def solve(A, N, B, M, K):
  
  def cumsum(l):
    rt = [0]
    s = 0
    for n in l:
      s += n
      rt.append(s)
    return rt
  
  preA = cumsum(A)
  preB = cumsum(B)
  
  total = N + M
  s, e = 0, total - 1
  
  def can_read(num):
    for i in range(N + 1):
      j = num - i - 1
      if j < (M + 1) and (preA[i] + preB[j]) <= K:
      	return True
    return False

  res = 0
  while s < e:
    mid = s + (e - s) // 2
    can = can_read(mid)
    
    if can:
      res = mid
      s = mid + 1
    else:
      e = mid - 1
  
  return res

res = solve(A, N, B, M, K)
print(res)

### FIXED CODE ###

N, M, K = map(int, input().split())
 
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
def solve(A, N, B, M, K):
  
  def cumsum(l):
    rt = [0]
    s = 0
    for n in l:
      s += n
      rt.append(s)
    return rt
  
  preA = cumsum(A)
  preB = cumsum(B)
  
  s, e = 0, N + M
  
  def can_read(num):
    for i in range(N + 1):
      j = num - i
      if j >= 0 and j < (M + 1) and (preA[i] + preB[j]) <= K:
      	return True
    return False

  res = 0
  while s <= e:
    mid = s + (e - s) // 2
    can = can_read(mid)
    
    if can:
      res = mid
      s = mid + 1
    else:
      e = mid - 1
  
  return res

res = solve(A, N, B, M, K)

print(res)
import math
A, B, C, D = map(int, input().split())
cd = math.gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//cd)
wari_B = B - (B// C + B // D - B//cd)
print(wari_B -wari_A)


### FIXED CODE ###

import fractions
A, B, C, D = map(int, input().split())
lcm = C * D // fractions.gcd(C,D)
wari_A = (A-1) - ((A-1) // C + (A-1) // D - (A-1)//lcm)
wari_B = B - (B// C + B // D - B//lcm)
print(wari_B -wari_A)
n, m = list(map(int, input().split(' ')))

broken = [False] * (n + 1)
for i in range(m):
    broken[int(input())] = True

mod = 1_000_000_007

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 0 if broken[1] else 1

for i in range(2, n + 1):
    if broken[i]:
        dp[i] = 0
    else:
        c = dp[i - 1] + dp[i - 2]
        if c > mod:
            c = c % mod
        dp[i] = c

print(dp[n])


### FIXED CODE ###

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

broken = [False] * (n + 1)
for i in range(m):
    broken[int(input())] = True

mod = 1000000007

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 0 if broken[1] else 1

for i in range(2, n + 1):
    if broken[i]:
        dp[i] = 0
    else:
        c = dp[i - 1] + dp[i - 2]
        if c > mod:
            c = c % mod
        dp[i] = c

print(dp[n])
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

### FIXED CODE ###

n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)
iimport collections

n=int(input())
l=list(map(int,input().split()))
s=collections.Counter(l)
s=list(s.items())
s=sorted(s,key=lambda x:x[0])
#print(s)
f=[0]*len(s)
for i in range(len(s)):
    f[i]=s[i][1]
    if i>=1:
        if s[i-1][0]==s[i][0]-1:
            f[i]+=s[i-1][1]
    if i<=len(s)-2:
        if s[i+1][0]==s[i][0]+1:
            f[i]+=s[i+1][1]
print(max(f))

### FIXED CODE ###

import collections

n=int(input())
l=list(map(int,input().split()))
s=collections.Counter(l)
s=list(s.items())
s=sorted(s,key=lambda x:x[0])
#print(s)
f=[0]*len(s)
for i in range(len(s)):
    f[i]=s[i][1]
    if i>=1:
        if s[i-1][0]==s[i][0]-1:
            f[i]+=s[i-1][1]
    if i<=len(s)-2:
        if s[i+1][0]==s[i][0]+1:
            f[i]+=s[i+1][1]
print(max(f))
n , k = map(int , input(),split())
ans = n - k + 1
print(ans)

### FIXED CODE ###

n , k = map(int , input().split())
ans = n - k + 1
print(ans)
# アキュムレータ版
D = 1000000007
n, m = map(int, input().split())
a = [0] * (10**5 + 1)
for i in range(m):
    a[int(input())] += 1

# 初期値
s0 = 1
if (a[1] == 1):
    s1 = 0
else:
    s1 = 1


def calc(l, acc1, acc2):
    # print("calc(l, acc1, acc2):" + str(l) + str(acc1) + str(acc2))
    if (l == 1):
        return acc2
    else:
        oldacc2 = acc2
        if (a[n - l + 2] == 1):
            acc2 = 0
        else:
            acc2 = acc1 + acc2
        acc1 = oldacc2
        return calc(l - 1, acc1, acc2) % D


print(calc(n, s0, s1))


### FIXED CODE ###

#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
D = 1000000007
n, m = map(int, input().split())
a = [0] * (10**5 + 1)
for i in range(m):
    a[int(input())] += 1

# 初期値
s = [0] * (n + 1)
s[0] = 1
if (a[1] == 1):
    s[1] = 0
else:
    s[1] = 1

# 暫定結果を格納する配列


def calc(n):
    if(a[n] == 1):
        return 0
    else:
        return (s[n - 1] + s[n - 2]) % D


def solver(n):
    for i in range(2, n + 1):
        s[i] = calc(i)


solver(n)
print(s[n])
#coding:utf-8
n, d = map(int, input().split())

flag = [0] * n
people = 1

#端を埋める
for i in range(0,2*d):
    flag[i] = 1

if sum(flag) != n:
    people += 1
for i in range(n-2*d-1, n):
    flag[i] = 1



#print(flag)

for i in range(2*d, n-2*d):
    if flag[i] == 0:
        people += 1
        #print(i)
        for j in range(i, i+d+1):
            if j > n-d:
                break 
            else:
                flag[j] = 1
        #print(flag)


#print(flag)
print(people)


### FIXED CODE ###

#coding:utf-8
n, d = map(int, input().split())

#監視員は2D+1本の木を監視する
#最小の監視員はN/2D+1 の切り上げ
print(-(-n // (2*d + 1)))
x = int(input())

pritn(24 + (24 - x))

### FIXED CODE ###

x = int(input())
 
print(24 + (24 - x))
a,b=map(int,input().split())
if b-a<=3:
  ans=a
  for i in range(a+1,b+1):
    ans=ans^i
  print(ans)
else:
  if a%4!=0:
    ans=a
    for i in range(a+1,(a//4)*4+2):
      ans=ans^i
  ans2=b
  for i in range(b+1,(b//4)*4+1):
    ans2=ans2^i
  print(ans^ans2)

### FIXED CODE ###

a,b=map(int,input().split())
if b-a<=3:
  ans=0
  for i in range(a,b+1):
    ans=ans^i
  print(ans)
else:
  ans=0
  if a%4!=0:
    for i in range(a,(1+a//4)*4):
      ans=ans^i
  ans2=0
  for i in range((b//4)*4,b+1):
    ans2=ans2^i
  print(ans^ans2)
n=int(input())
z=list(map(int,input().split()))
for i in range(1,n):
    v=z[i]
    j=i-1
    while j>=0 and z[j]>v:
        z[j+1]=z[j]
        j-=1
        
    z[j+1]=v
    print(''.join(z))

### FIXED CODE ###

n=int(input())
z=list(map(int,input().split()))
print(' '.join(list(map(str,z))))
for i in range(1,n):
    v=z[i]
    j=i-1
    while j>=0 and z[j]>v:
        z[j+1]=z[j]

        j-=1
        z[j+1]=v
    print(' '.join(list(map(str, z))))
from functools import reduce
from operator import mul

mod = 10**9 + 7

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

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

if N == K:
    print(reduce(mul, A)%mod)

else:

    AP = []
    AM = []
    for i in A:
        if i < 0:
            AM.append(i)
        else:
            AP.append(i%mod)
            
    if len(AP) == 0 and K%2 != 0:
        AM.sort(reverse=True)
        AM = AM[:K]
        print(reduce(mul, AM)%mod)

    else:
        
        AP.sort(reverse=True)
        AM.sort()
        
        p = 0
        m = 0
        ans = 1
        cnt = 0

        while True:
            if p+1 <= len(AP) - 1 and m+1 <= len(AM) - 1 and AM[m]*AM[m+1] > AP[p]*A[p+1]:
                ans *= AM[m]*AM[m+1]%mod
                m += 2
                cnt += 2
                
            else:
                ans *= AP[p]%mod
                p += 1
                cnt += 1
            
            if K == cnt:
                break

        print(ans%mod)

### FIXED CODE ###

from bisect import bisect_left,bisect_right
p=10**9+7
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
pi=1
ni=0
ans=1
i=0
while i<k-1:
  if a[ni]*a[ni+1]>a[-pi]*a[-pi-1]:
    ans=ans*a[ni]*a[ni+1]%p
    ni+=2
    i+=2
  else:
    ans=ans*a[-pi]%p
    pi+=1
    i+=1
if i==k-1:
  ans=ans*a[-pi]%p
if a[-1]<0 and k%2==1:
  ans=1
  for i in a[n-k:]:
    ans=ans*i%p
print(ans)
a=int(input())
b=int(input())
h=int(input())
print((a+b)＊h/2)

### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())
print((a+b)*h//2)
N, A, B = map(int, input().split())
mo = 10 ** 9 + 7
def hanaya(n, x):
    if x == 1:
        return n
    else:
        return ((hanaya(n, x-1))*((n-x+1)/x))%mo

ans = (pow(2, N) - 1 - hanaya(N, A)- hanaya(N, B)) % mo
print(int(ans))

### FIXED CODE ###

N, A, B = map(int, input().split())
mo = 1000000007
A_val = 1
for i in range(A):
    A_val = ((A_val * (N - i) * pow(i+1, mo-2, mo))) % mo
B_val = 1
for i in range(B):
    B_val = ((B_val * (N - i) * pow(i+1, mo-2, mo))) % mo
    
ans = (pow(2, N, mo) - 1 - A_val - B_val) % mo
print(ans)
S = input()

count0, count1 = 0, 0
val = []
for i in range(len(S)):
    if S[i] == '<':
        count0 += 1
        if count1 != 0:
            val.append(count1)
        if i == len(S)-1:
            val.append(count0)
        count1 = 0
    else:
        count1 += 1
        if count0 != 0:
            val.append(count0)
        if i == len(S)-1:
            val.append(count1)
        count0 = 0
print(val)
ans = 0
for i in range(0, len(val)-1, 2):
    a = max(val[i], val[i+1])
    b = min(val[i], val[i+1])
    ans += a*(a+1)/2 + (b-1)*b/2
if len(val) % 2 == 1:
    a = max(val[-2], val[-1])
    #b = min(val[i], val[i+1])
    ans += a*(a+1)/2 #+ (b-1)*b/2    
print(int(ans))


### FIXED CODE ###

s = input()
num = len(s)
a = [0]*(num+1)

for i in range(num):
    if s[i] is '<':
        a[i+1] = max(a[i+1], a[i]+1)

for i in range(1, num+1):
    if s[-i] is '>':
        a[-(i+1)] = max(a[-(i+1)], a[-i]+1)
print(sum(a))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

n, m, q = MAP()
tmp = list(range(1, m + 1)) * m
arr = list(combinations(tmp, n))
arr = [sorted(list(i)) for i in arr]
#print(arr)
point = [0 for _ in range(len(arr))]
for i in range(q):
    a, b, c, d = MAP()
    for j in range(len(arr)):
        if arr[j][b - 1] - arr[j][a - 1] == c:
            point[j] += d
#print(point)
print(max(point))


### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

n, m, q = MAP()
arr = [[]]
for i in range(n):
    tmp = deepcopy(arr)
    arr = []
    for j in range(1, m + 1):
        for k in range(len(tmp)):
            if len(tmp[k]) == 0 or tmp[k][-1] <= j:
                arr.append(deepcopy(tmp[k]))
                arr[-1].append(j)

point = [0 for _ in range(len(arr))]
for i in range(q):
    a, b, c, d = MAP()
    for j in range(len(arr)):
        if arr[j][b - 1] - arr[j][a - 1] == c:
            point[j] += d
#print(point)
print(max(point))
n = int(input())
s = []
for _ in range(n):
    s.append(input())
check = []
testc = 1000
for i in range(n):
    test = 0
    for c in s[i]:
        test += int(c)
    if test == testc:
        check.append(i)
    elif test < testc:
        check.clear()
        testc = test
        check.append(i)

res = -1
for i in check:
    tres = 1
    flag = [-2 for _ in range(n)]

    flag[i] = 1
    que = [i]
    while que:
        target = que.pop()
        for j in range(n):
            if s[target][j] == "1":
                if flag[j] == -2:
                    flag[j] = flag[target] + 1
                    que.append(j)
                elif flag[j] != flag[target] + 1 and flag[j] != flag[target] - 1:
                    tres = -1
                    break
        if tres == -1:
            break
    if tres == -1:
        continue
    else:
        res = max(res, max(flag))

print(res)


### FIXED CODE ###

s = input()
k = int(input())
if len(s) == 1:
    print(k // 2)
else:

    def counts(s):
        count = 0
        for i in range(len(s) - 1):

            if s[i] == s[i + 1]:
                count += 1
                s = s[: i + 1] + "." + s[i + 2 :]
        return count

    res1 = counts(s)
    res2 = counts(s * 2)
    res3 = counts(s * 3)
    if res3 - res2 == res2 - res1:
        print(res1 + (res2 - res1) * (k - 1))
    else:
        if k % 2 == 1:
            print(res2 * (k // 2) + res1)
        else:
            print(res2 * (k // 2))
if a >= 3200:
    print('s')
elif a < 3200:
    print('red')

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
    print(s)
elif a < 3200:
    print('red')
S = input()
A = S.split()

for i in A:
    if A[i] == A[i + 1]:
        print('Bad')
    else:
        print('Good')


### FIXED CODE ###

S = input()

if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print('Bad')
else:
    print('Good')
a = list(map(int,input()))

if a[2]<a[0]:
  print("NO")
else:
  if a[2]<=a[0]+a[1]:
    print("YES")
  else:
    print("NO")

### FIXED CODE ###

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

if a[2]<a[0]:
  print("NO")
else:
  if a[2]<=a[0]+a[1]:
    print("YES")
  else:
    print("NO")
a,b,c =  list(map(int, input().split()))

for i in range(b):
	if i*a%(b+1) == c:
		print('YES')
		sys.exit()

print('NO')

### FIXED CODE ###

import sys
a,b,c =  list(map(int, input().split()))

for i in range(b):
	if (i+1)*a%b == c:
		print('YES')
		sys.exit()

print('NO')
def solve(X, Y, Z, V, E, A):
    dp = [[0.0] * 6001 for _ in range(Y + max(V) + 1)]
    dp[0][0] = 1.0
    for i in range(Y):
        for j in range(5001):
            if dp[i][j] <= 0.0:
                continue
            for k in V:
                t = i + k
                if t > Y:
                    dp[Y][j] += dp[i][j]/X
                elif E[t] == 1:
                    dp[min(Y, t+A[t])][j] += dp[i][j]/X
                else:
                    dp[t][max(0, j+A[t])] += dp[i][j]/X

    s = 0
    for i in range(5001):
        if dp[Y][i] <= 0.0:
            continue
        s += i * dp[Y][i]
    print int(s)

if __name__ == "__main__":
    import sys

    while True:
        X, Y, Z = map(int, input().split())
        if X | Y | Z == 0:
            sys.exit()
        V = map(int, input().split())
        E = [0] * 100
        A = [0] * 100
        for _ in range(Z):
            n, e, a = map(int, input().split())
            E[n] = e
            if e == 3:
                A[n] = -a
            else:
                A[n] = a
        solve(X, Y, Z, V, E, A)

### FIXED CODE ###

def solve(X, Y, Z, V, E, A):
    dp = [[0.0] * 6001 for _ in range(Y + 11)]
    dp[0][0] = 1.0
    for i in range(Y):
        for j in range(5001):
            if dp[i][j] <= 0.0:
                continue
            for k in V:
                t = i + k
                if t > Y:
                    dp[Y][j] += dp[i][j]/X
                elif E[t] == 1:
                    dp[min(Y, t+A[t])][j] += dp[i][j]/X
                else:
                    dp[t][max(0, j+A[t])] += dp[i][j]/X

    s = 0
    for i in range(5001):
        s += i * dp[Y][i]
    print(int(s))

if __name__ == "__main__":

    while True:
        X, Y, Z = map(int, input().split())
        if X | Y | Z == 0:
            break
        V = list(map(int, input().split()))
        E = [0] * 100
        A = [0] * 100
        for _ in range(Z):
            n, e, a = map(int, input().split())
            E[n] = e
            if e == 3:
                A[n] = -a
            else:
                A[n] = a
        solve(X, Y, Z, V, E, A)
n = len([s for s in S if s == "x"])
if n >= 8: print("NO") 
else: print("YES")

### FIXED CODE ###

n = len([s for s in input() if s == "x"])
if n < 8: print("YES")
else: print("NO")
#!/usr/bin/env python3
import sys
from functools import reduce
import fractions

MOD = 1000000007  # type: int


def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def solve(N: int, A: "List[int]"):
    m = lcm(*A)

    def sumup(x, y):
        return (x + m // y) % MOD
    print(reduce(sumup, A, 0))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int):
    print(YES if N == M else NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    solve(N, M)


if __name__ == '__main__':
    main()
n, k = map(int, input().split())

if k == 0:
  print(n**2)


ans = 0
for b in range(1, n+1):
  ans += N//b * max(0, b-k)
  ans += max(0, n%b+(1-k))
  
print(ans)

### FIXED CODE ###

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

if k == 0:
  print(n**2)
  exit()


ans = 0
for b in range(1, n+1):
  ans += n//b * max(0, b-k)
  ans += max(0, n%b+(1-k))
  
print(ans)
import math
a,b = map(str,input().split())
a = int(a)
b.remove(,)
# print(a,b)
b = int(b)
ans = (a*b)//100
print(ans)

### FIXED CODE ###

import math
a,b = map(str,input().split())
a = int(a)
b_ =str()
for i in b:
    if(i != "."):
        b_ = b_ +i
# print(b_)
b_ = int(b_)
ans = (a*b_)//100
print(ans)