peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from math import atan, degrees
a, b, x = map(int, input().split())
vol = a**2*b/2
if x < vol:
    ans = atan((a*b**2)/(2*x))
elif x > vol:
    ans = atan((-2/a**3)*(x-a**2*b))
else:
    ans = atan(b/a)
print(degrees(ans))
# Judge status: Wrong Answer
w = str(input())
List = [w[i] for i in range(len(w))]
lis = sorted(List)
#print(lis)
uni = list(set(lis))
#print(uni)
ans = []
q = 0
for i in range(len(uni)):
    p = lis.count(uni[i])
    ans.append(p)
for j in range(len(ans)):
    q += ans[j]%2
if q == 0:
    print("YES")
else:
  print("NO")
# Judge status: Wrong Answer

W, H, x, y = map(int, input().split())

print("{0} {1}".format(H * W / 2, int(x + x == W & y + y == H)))
# Judge status: Accepted
n,k = map(int,input().split())

if n%k == 0:
  print(0)
else:
  print(1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
def MI():
    return map(int, input().split())

n = int(input())
z=[]
w=[]
for i in range(n):
    x,y=MI()
    z.append(x+y)
    w.append(x-y)

print(max(max(z)-min(z), max(w)-min(w)))
# Judge status: Accepted
import sys

n, h = map(int, input().split())
a = [list(map(int, x.split())) for x in sys.stdin.readlines()]
a.sort(reverse=True)
b = sorted(a, key=lambda x:x[1], reverse=True)
cnt = 0
for i in b:
    if i[1] < a[0][0]:
        break
    cnt += 1
    h -= i[1]
    if h <= 0:
        print(cnt)
        exit()
print(cnt + -(-h//a[0][0]))
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
s = input()

all = list(s)
count = 0
count_b = 0
for i in all:
    if i == 'a':
        if count < a + b:
            print('Yes')
            count += 1
        else:
            print('No')
    elif i == 'b':
        if (count < a + b) and (count_b <= b):
            print('Yes')
            count += 1
            count_b += 1
        else:
            print('No')
    else:
        print('No')
# Judge status: Accepted
import itertools
n, m, q = map(int , input().split(" "))
l = []
for i in range(q):
    a, b, c, d = map(int, input().split(" "))
    l.append((a, b, c, d))


def score(l, t):
    score = 0
    for i in l:
        a, b, c, d = i
        if t[b-1] - t[a-1] == c:
            score = score + d
    return score

print(max([ score(l, t)  for t in itertools.combinations_with_replacement(list(range(1, m+1)), n)] ))
# Judge status: Accepted
def main():
    n = int(input())

    t = 1

    ans = ''
    while n > 0:
        p = ((n - 1) // t) % 26
        ans += chr(ord('a') + p)
        n -= t * (p+1)
        t *= 26

    ans = ans[::-1]

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
c = len(str(n))
if c == 1:
    print(n)
else:
    for i in range(1,10):
        b = int(str(i)+"9"*(c-1))
        if int(str(i)+"9"*(c-1)) >= n:
            print(9*(c-1)+(i-1))
            break
# Judge status: Wrong Answer
import itertools
N,K=map(int,input().split())
D=[int(x) for x in input().split()]
T=[]
answer=10000
for i in range(10):
  if not i in D:
    T+=[i]
for x in itertools.product(T,repeat=4):
  for i in range(5):
    p=x[-1]+x[-2]*10+x[-3]*100+x[-4]*1000
    if p>=N:
      answer=min(p,answer)
print(answer)
# Judge status: Accepted

s=input()

c0=s.count("0")
c1=s.count("1")

print(2*min(c0,c1))
# Judge status: Accepted
n = int(input())

a = [0]*n

a = [int(s) for s in input().split()]


dic = {}
for s in a:
    if not (s in dic):
        dic[s] = 1
    else:
        dic[s] += 1


for i in range(n):
    if not(i+1 in dic):
        print(0)
    else:
        print(dic[i+1])
# Judge status: Wrong Answer
#!/usr/bin/env python3

h1, m1, h2, m2, k = list(map(int, input().split()))


if h2*60+m2-h1*60+m1 < 0:
    print((h2+24)*60+m2-h1*60+m1-k)
else:
    print(h2*60+m2-h1*60+m1-k)
# Judge status: Wrong Answer
A,B=input().split()
A=int(A)
B=int(100*(float(B)+0.005))
print(int(A*B))
# Judge status: Accepted
def main():
    # n = int(input())
    # t, a = map(int, input().split())
    # h = list(map(int, input().split()))
    s = input()
    mini = 10**10
    for i in range(len(s)-2):
        mini = min(mini, abs(int(s[i:i+3]) - 753))

    print(mini)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
from bisect import bisect_left, bisect_right
N = int(input())
*A, = map(int, input().split())
A.sort()
m = A[-1]
div = m / 2
print(m, min(abs(m - A[bisect_right(A, m / 2)]), abs(m - A[bisect_left(A, m / 2)])))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))


for i in a:
    if i % 2 == 0:
        if i % 3 == 0:
            continue
        elif i % 5 == 0:
            continue
        else:
            print('DENIED')
            exit()

print('APPROVED')
# Judge status: Wrong Answer
N = int(input())
a = {i + 1: int(input()) for i in range(N)}
ans = -1

count = 0
nxt = 1
while count < N:
  nxt = a[nxt]
  if nxt == 2:
    ans = count
    break
  count += 1

print(ans)
# Judge status: Wrong Answer
li = input().split()
a=int(input())
magic = 0
for i in range(0,3):
    if li[0] >= li[1]:
        li[1] = li[1] * 2
        magic = magic + 1

for i in range(0,3):
    if li[1] >= li[2]:
        li[2] = li[2] * 2
        magic = magic + 1
        
if a >= magic:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    ans=[x,abs(d-x)]
    print(ans[k%2])
# Judge status: Accepted
n, k = map(int, input().split())
X = list(map(int, input().split()))
ans = pow(10,9)+7
for i in range(n-k+1):
    ans = min(ans, min(abs(X[i])+abs(X[i+k-1]-X[i]), abs(X[i+k-1])+abs(X[i]-X[i+k-1])))
print(ans)
# Judge status: Accepted
s = str(input())
n = len(s)

ans = []
for i in range(n):
    if s[i] != 'B':
        ans.append(s[i])
    else:
        if len(ans) > 0:
            ans.pop(-1)
        else:
            continue
print(''.join(ans))
# Judge status: Accepted
x = int(input())

m = 100
res = 0

while(True):
    m *= 1.01
    m = int(m)
    res += 1

    if(m >= x): break

print(res)
# Judge status: Accepted
N = int(input())
S = input()

if N % 2 == 0 and S[:N // 2] == S[-N // 2:]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x, a, b = map(int, input().split())

if x > a:
    if x > b:
        print('delicious')
    else:
        print('safe')
else:
    print('dangerous')
# Judge status: Accepted
s = input()

s_right = s[len(s)//2:][::-1]
s_left = s[:len(s)//2]
count = 0
for i in range(len(s_left)):
    if s_right[i] != s_left[i]:
        count += 1

print(count)
# Judge status: Accepted
x, k, d = map(int, input().split())

dx = abs(x)
y = dx // d

if k >= y:
    dx = dx - y * d
    if (k-y) % 2 == 0:
        print(dx)
    else:
        dx = abs(dx - d)
        print(dx)
elif k < y:
    dx = dx - k * d
    print(dx)
# Judge status: Wrong Answer
N = int(input())
T,A = list(map(int,input().split()))
H = list(map(int,input().split()))
MinDif = 1000
for i in range(N):
  Temp = T - H[i] * 0.006
  if abs(Temp - A) == min( MinDif, abs(Temp - A) ):
    MinDif = abs(Temp - A)
    ans = i
print(ans)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

flag = True
for a in A:
    if a % 2 != 0:
        flag = False

if flag:
    if P == 0:
        ans = 2 ** N
    else:
        ans = 0
else:
    ans = 2 ** (N-1)

print(ans)
# Judge status: Accepted
q, h, s, d = [int(x) for x in input().split()]
n = int(input())
per_l = min(4 * q, 2 * h, s)   # 1L買うのに一番安い方法
per_2l = min(2 * per_l, d) # 2Lを買うのに一番安い方法

print(per_2l * (n // 2) + per_l * (n % 2))
# Judge status: Accepted
#abc174_b

n,d=map(int,input().split())
def ok(x,y):
    return x**2+y**2<=d**2
cnt=0
for _ in range(n):
    a,b=map(int,input().split())
    if ok(a,b):
        cnt+=1
print(cnt)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
cnt=0
ans=0
m=10**9+1
for i in a:
    if i<0: cnt+=1
    ans+=abs(i)
    if abs(i)<m: m=abs(i)
if cnt%2==0:
    print(ans)
else:
    print(ans-m*2)
# Judge status: Wrong Answer
n = int(input())
if n&1:
    print(sum(list(map(int, str(n)))))
elif n < 10:
    print(n)
else:
    print(10)
# Judge status: Wrong Answer
n,x = map(int,input().split())
l = list(map(int,input().split()))
count = 1
x1 = 0
for i in range(n):
  if x1 + l[i] <= x:
    count += 1
    x1 += l[i]
  else:
    print(count)
    exit()
# Judge status: Accepted
original_s = list(input())
s = list(map(lambda x:ord(x)-97-26, original_s))
K = int(input())

ans = original_s
for i in range(len(s)):
    if abs(s[i]) <= K and s[i] != -26:
        ans[i] = "a"
        K += s[i]

ans[-1] = chr(((ord(ans[-1]) + K) - 97) % 26 + 97)

print("".join(ans))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

a.sort(reverse=True)

migi = a[1]
hidari = a[1]
point = a[0]

for i in a[2:]:
    if migi >= hidari:
        point += migi
        migi = i
    else:
        point += hidari
        hidari = i

print(point)
# Judge status: Wrong Answer
import numpy as np

a = 1
b = 2
c = a * b

if 1 < c and c < 1000:
  if c%2 == 0:
    print("Even")
  else:
    print("Odd")
# Judge status: Accepted
N=int(input())
S=input()
ans=0
for i in range(N-1):
	F=set(S[:i+1])
	G=set(S[i+1:])
	ans=max(ans,len(F&G))
print(ans)
# Judge status: Wrong Answer
a,b,c=input().split()
print('A',b[0],'C')
# Judge status: Wrong Answer
N = int(input())
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

cnt = 0
A = A[::-1]
B = B[::-1]
for a, b in zip(A, B):
    if a % b == 0:
        continue
    cnt += b - ((a + cnt) % b)
print(cnt)
# Judge status: Accepted
def main():
    n, m = list(map(int, input().split()))
    works = list(map(int, input().split()))

    for w in works:
        n -= w
    print(-1) if n < 0 else print(n)



if __name__ == '__main__':
    main()
# Judge status: Accepted
t=list(map(int,input().split()))
t.sort()
a,b,c=t[0],t[1],t[2]
if (a*b*c)%2==0:
  print(0)
else:
  print(a*b)
# Judge status: Accepted
n,m = map(int,input().split())
a = [list(input()) for i in range(n)]
b = [list(input()) for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        t = 1
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] != b[k][l]:
                    t = 0
        if t == 1:
            print('Yes')
            exit(0)

print('No')
# Judge status: Accepted
from itertools import permutations
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
x = [i for i in range(1, n + 1)]
y = []
for i in permutations(x, n):
    y.append(list(i))
a = b = 0
for i in range(len(y)):
    if y[i] == p:
        a = i + 1
    if y[i] == q:
        b = i + 1
print(abs(a - b))
# Judge status: Accepted
#D
N=int(input())
A=list(map(int,input().split()))
ans=0
num=1
for i in range(N):
    if A[i]==num:
        num+=1
    else:
        ans+=1
if num==1:
    ans=-1
print(ans)
# Judge status: Accepted
N,K,Q = map(int,input().split())
A = [int(input()) for i in range(Q)]
num = K-Q
point = [num]*N

for a in A:
  point[a-1] += 1

for po in point:
  if po > 0:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
n, k = map(int, input().split())
ans=0
for i in range(1, n+1):
  a=1/n
  now=i
  while(now<k):
    now*=2
    a/=2
  ans+=a
print(ans)
# Judge status: Wrong Answer
import math
N, K = map(int, input().split())

ANS = 0


for i in range(1,N+1):
    if i < K:
        ANS += (1/N) * (0.5**(math.ceil(math.log(math.ceil(K/i),2))))
    else:
        ANS += (1/N)*(N-K+1)
        break
    print(math.ceil(math.log(math.ceil(K/i),2)))

print(ANS)
# Judge status: Wrong Answer
A=(int)(input())
B=(int)(input())
C=(int)(input())
X=(int)(input())

count = 0
a_ = X//500
if a_>A:
    a_ = A
for a in range(a_+1):
    x = X-a*500
    b_ = x//100
    if b_>B:
        b_ = B
    for b in range(b_+1):
        x = x-b*100
        c_ = x//50
        if c_<=C:
            count = count + 1

print(count)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a = [int(item) for item in input().split()]
l = 0; r = 1000000001
while r - l > 1:
    mid = (l + r) // 2
    cnt = 0
    for item in a:
        cnt += (item - 1) // mid
    # Can be cut in k times
    if cnt <= k:
        r = mid
    else:
        l = mid

print(l + 1)
# Judge status: Accepted
N = int(input())
S = input()

if N % 2 == 1:
    print("No")
else:
    if S[0:N//2] == S[N//2:N]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
s = list(input())
before = s[0]
ans = 1
tmp = ""

for i in range(1, len(s)):
    tmp += s[i]
    if tmp != before:
        ans += 1
        before = tmp
        tmp = ""
print(ans)
# Judge status: Accepted
from bisect import bisect_left, bisect_right
n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
    a_cnt = bisect_left(a, b[i], 0, n)
    c_cnt = n - bisect_right(c, b[i], 0, n)
    #print(a_cnt, c_cnt)
    ans += a_cnt * c_cnt

print(ans)
# Judge status: Wrong Answer
# 問題文
# シカのAtCoDeerくんは二つの正整数 a,bを見つけました。
# aとbの積が偶数か奇数か判定してください。

# 制約
# 1 <= a,b <= 10000
# a,bは整数


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

# 積が奇数なら、0dd と偶数なら Even と出力
i = a * b

if i % 2 == 0:
    print('Even')
else:
    print('0dd')
# Judge status: Accepted
N = int(input())
p = list(map(int,input().split()))

c = 0
for i in range (N):
    if p[i] != i+1:
        c += 1

if c == 0 or c==2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
x, y = map(int, input().split())
d = abs(abs(x) - abs(y))
if 0 <= x < y or x < y <= 0:
  print(d)
elif y <= 0 <= x or x < 0 < y:
  print(d+1)
else:
  print(d+2)
# Judge status: Wrong Answer
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
D = defaultdict(int)
ans = 0

for i, x in enumerate(A, 1):
    ans += D[i-x]
    D[x+i] += 1

print(ans, D)
# Judge status: Accepted
n, k = map(int, input().split())
As = list(map(int, input().split()))

idx = As.index(min(As))
left = idx

n_l = (left + k - 2) // (k - 1)

right = n - ((n_l) * (k-1)) - 1

n_r = (right + k - 2) // (k - 1)

print(n_l + n_r)
# Judge status: Accepted
# solution

data=int(input())
array=list(map(int,input().split()))

result=[]
box=[0]*data

for i in reversed(range(1,data+1)):
  asum=sum(box[i-1::i])
  if asum%2+array[i-1]==1:
    box[i-1]=1
    result.append(i)

print(len(result))
print(*result)
# Judge status: Wrong Answer
N=input()
if N.count('a')%2==0:
    print('Yes')
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

b = [val//400 for val in a]
#print(b)
c = set(b)
if b.count(8):
    M=len(c)-1+b.count(8)
    m=len(c)-1
    if m == 0:
        m=1
else:
    M=len(c)
    m=M
print(m, M)
# Judge status: Accepted
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

def main():
    a, b, c, x, y = MII()
    fee = min(a+b,c*2) * min(x,y)
    if x > y: fee += min(a,c*2)*(x-y)
    else: fee += min(b,c*2)*(y-x)
    print(fee)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = input()
a = [int(c) for c in n]
if(a[-1] == 3):
    print('bon')
elif(a[-1] == 0 or 1 or 6 or 8):
    print('pon')
else:
    print('hon')
# Judge status: Wrong Answer
s = input()

ans = 0
bef = 0

for i in s[::-1]:
    v = int(i)
    if v+bef>=5:
        ans += 10-(v+bef)
        bef = 1
    else:
        ans += (v+bef)
        bef = 0

ans += (v+bef)//10
print(ans)
# Judge status: Accepted
n=int(input())
lst = []
cnt = 1000
while n > 0:
    lst.append(n%10)
    n //= 10 # 必須
lst.reverse()
for j in range(len(lst)-2):
  temp=lst[j]*100+lst[j+1]*10+lst[j+2]
  if abs(temp-753)<cnt:
    cnt=abs(temp-753)
print(cnt)
# Judge status: Wrong Answer
n=int(input())
x=list(map(int,input().split()))
a=n//2
b=a+1
for i in range(a):
  print(x[a])
for i in range(a):
  print(x[a-1])
# Judge status: Accepted
import math
n, k = map(int,input().split())
dat = list(map(int, input().split()))
i = dat.index(1) + 1 # 1 origin で i 個目に 1 がある
reach = k # 今1で占有した場所
a = math.ceil((n - reach) / (k - 1))
print(1+a)
# Judge status: Wrong Answer
n = int(input())
p = [int(_) for _ in input().split()]

cnt = 0
for i in range(0, n-2):
    print(p[i], p[i+1], p[i+2])
    if (p[i] < p[i+1] < p[i+2]) or (p[i] > p[i+1] > p[i+2]):
        cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input())
p = [int(i) for i in input().split()]
count = 0
i = 0
while i < N:
    if p[i]-1==i:
        if i+1 != N:
            if p[i+1]-1==i+1:
                i += 1
                count += 1
            else:
                count += 1
        else:
            count += 1
    i += 1

print(count)
# Judge status: Accepted
if sum(int(i) for i in input()) % 9:
	print('No')
else:
	print('Yes')
# Judge status: Accepted
def main():
    N = int(input())
    *A, = map(int, input().split())

    tot = sum(A)

    ans = 1
    tot -= 1
    v = 1
    for x in A:
        v -= x
        if v < 0:
            print(-1)
            return
        make_v = min(v, tot)
        tot -= make_v
        v += make_v
        ans += v

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
#coding:utf-8
n=int(input())
A=list(map(int,input().split()))
if len(A)==len(set(A)):
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
n =input()
a=n.count("<")
b =n.count(">")

c = a+b

print(int((c-1)*c/2))
# Judge status: Accepted
n = int(input())

if n // 10 == 9 or n % 10 == 9:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
S = input()
ans = 0
ACGT = ["A","C","G","T"]
for i in range(len(S)):
    for j in range(i,len(S)+1):
        clipped_list = list(S[i:j])
        clipped = set(clipped_list)
        for acgt in ACGT:
            try:
                clipped.remove(acgt)
            except:
                pass
        if clipped == set():
            ans = max(ans,len(clipped_list))

print(ans)
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1, N):
    ans += (N - 1) // i
print(ans)
# Judge status: Accepted
import fractions
A, B, C, D = [int(i) for i in input().split()]
result = B+1 - A
def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)
def wareru(min_num, max_num, waru):
    return (max_num)//waru - (min_num-1)//waru
result -= wareru(A, B, C) + wareru(A, B, D) - wareru(A, B, lcm(C,D))
print(result)
# Judge status: Accepted
S = input()
slist = list(S)
sset = set(slist)
if slist.count(slist[0]) == 2 and len(sset) == 2:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A = list(map(int, input().split()))

print(A.index(0)+1)
# Judge status: Wrong Answer
input()
a = list(map(int, input().split()))
b = []
for i in range(len(a)):
  if (a[i] % 2) == 0:
    if (((a[i] % 3) == 0) or ((a[i] % 5) == 0)):
      b.append(True)
    else: 
      b.append(False)
if (len(b) == 0) or (False in b):
  print("APPROVED")
else:
  print("DENIED")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int, input().split()))

delta_a = [0] * (n-1)
for i in range(n-1):
  delta_a[i] = a[i+1] - a[i]

stock = 0
money = 1000
for i in range(n-1):
  if delta_a[i] > 0 and (delta_a[i-1] <= 0 or i == 0):
    stock = money // a[i]
    money = money % a[i]
  elif delta_a[i] < 0 and delta_a[i-1] >= 0  and stock != 0:
    money += stock * a[i]
    stock = 0

if stock != 0:
  money += stock * a[n-1]
print(money)
# Judge status: Accepted
n,m=map(int,input().split())
k=n*(n-1)/2
l=m*(m-1)/2
k=int(k)
l=int(l)
if n>=2 and m>=2:
    print(k+l)
elif n>=2 and m<2:
    print(k)
elif n<2 and m>=2:
    print(l)
else:
    print(0)
# Judge status: Accepted
H=int(input())

enemy=1
ans=0
while H>0:
    ans+=enemy
    H//=2
    enemy*=2
print(ans)
# Judge status: Accepted
S=input()
T=input()
ans = 0
for s, t in zip(S, T):
    if s != t:
        ans += 1
print(ans)
# Judge status: Accepted
from math import gcd
n, x = map(int, input().split())
x = list(map(lambda xi: abs(int(xi) - x), input().split()))
g = x[0]
for xi in x:
    g = gcd(g, xi)
print(g)
# Judge status: Wrong Answer
k, n = map(int, input().split())
a = list(map(int, input().split()))
if len(a) == n:
    if 0 in a:
        a.remove(0)
    a.sort()
    ans = 0
    n = 1
    for i in a:
        try:
            ans += a[n] - a[n-1]
            n += 1
        except:
            pass
    print(ans)
# Judge status: Accepted
s = input()
k = int(input())
l = len(s)
pos = 0

for i in range(l):
    if s[i] != "1":
        pos = i
        break
if k - 1 < pos:
    print(s[k - 1])
else:
    print(s[pos])
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B, T = LI()

    ans = T // A * B
    print(ans)

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
import statistics

NN = int(input())
AA = list(map(int,input().split()))
BB = [0]*NN
for nn in range(1,NN+1):
    BB[nn-1] = AA[nn-1] - nn
#print(BB)
MBB = statistics.median(BB)

CC = list(map(lambda x: x - MBB, BB))
#print(CC)
ACC = list(map(lambda x: abs(x),CC))
ANS = sum(ACC)
print(int(ANS))
# Judge status: Accepted
import sys
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = [ri() for _ in range(6)]
print(':(' if li[4] - li[0] > li[5] else 'Yay!')
# Judge status: Accepted
N,T = map(int, input().split())
ct=[list(map(int, input().split())) for _ in range(N)]
#print(ct)
max=1001
for i in range(N):
    if ct[i][1]>T:
        continue
    else:
        if ct[i][0]<max:
            max=ct[i][0]
if max==1001:
    print('TLE')
else:
    print(max)
# Judge status: Wrong Answer
from collections import Counter
from functools import reduce

n = int(input())
s = input()

kw = Counter(s)
ans = reduce(lambda x, y: x * y, kw.values())

for i in range(n - 2):
    for j in range(i + 1, n - 1):
        k = 2 * j - i
        if j < k <= n - 1 and s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            ans -= 1

print(ans)
# Judge status: Wrong Answer
import sys


def sum_(i):
    return i * (i + 1) // 2


if __name__ == "__main__":
    N = int(input())
    sum_score = 0
    if N == 1:
        print(1)
        sys.exit(0)
    for i in range(1, N + 1):
        if sum_(i) <= N:
            sum_score = sum_(i)
        else:
            break
    for x in list(range(1, i - 1)) + [(N - sum_score) + (i - 1)]:
        print(x)
# Judge status: Wrong Answer
N, K = map(int, input().split())
#%%time
i = 0
ans = 0
while i <= 10**9:
    if N < K:
        ans = 1
        break
    elif N == K:
        ans = 2
        break
    elif K**i < N:
        i += 1
    else :
        ans = i
        break 
print(ans)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
no = list(map(int, input().split()))

red = sorted(red, reverse=True)[:X]
green = sorted(green, reverse=True)[:Y]
no = sorted(no, reverse = True)[:X+Y]

co = sorted(red+green)

for i in range(len(no)):
    if no[i]>co[i]:
        co[i] = no[i]
    else:
        break
        
print(sum(co))
# Judge status: Accepted
n, m = map(int, input().split())
MOD = 10**9 + 7

if abs(n - m) > 1:
    print(0)
elif n == m:
    ans = 1
    for i in range(2, n + 1):
        ans *= i
        ans %= MOD
    # xoxoxo... とoxoxox... 、どっちを先にするかで2種類
    print(2 * ans * ans % MOD)
else:
    ans = 1
    for i in range(2, n + 1):
        ans *= i
        ans %= MOD
    for i in range(2, m + 1):
        ans *= i
        ans %= MOD
    print(ans)