Harryxun/stf_run huggingface dataset:
import math
def combination(p, q):
    if q < 0 or p < q:
        return 0
    return math.factorial(p) / math.factorial(q) / math.factorial(p - q)
a, b, c = map(int, input().split())
c -= a * b
print(int(combination(c + a - 1, c)))

### FIXED CODE ###

import math
def combination(p, q):
    if q < 0 or p < q:
        return 0
    return math.factorial(p) // math.factorial(q) // math.factorial(p - q)
a, b, c = map(int, input().split())
c -= a * b
print(combination(c + a - 1, c))
import sys
    input = sys.stdin.readline


    def main():
        N, M = map(int, input().split())
        mod = (10**9)+7
        if abs(N-M) >= 2:
            print(0)
        else:
            ans = 1
            for n in range(1, N+1):
                ans = ans * n % mod
            for m in range(1, M+1):
                ans = ans * m % mod
            if N == M:
                ans = ans * 2 % mod
            print(ans)


    if __name__ == '__main__':
        main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    N, M = map(int, input().split())
    mod = (10**9)+7
    if abs(N-M) >= 2:
        print(0)
    else:
        ans = 1
        for n in range(1, N+1):
            ans = ans * n % mod
        for m in range(1, M+1):
            ans = ans * m % mod
        if N == M:
            ans = ans * 2 % mod
        print(ans)


if __name__ == '__main__':
    main()
n,r=map(int,input())
if n<=10:
  print(r)
else:
  print(r-100*(10-n))
  

### FIXED CODE ###

n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  print(r+100*(10-n))
X = input().split()

A = int(X[0])
B = int(X[1])

p = A + B
m = A - B
k = A * B

if p > m and p > k:
    max_s = p
elif m > p and m > k:
    max_s = m
elif k > p and k > m:
    max_s = k
elif A == B and A == 0:
    max_s = p

print(max_s)


### FIXED CODE ###

N = input().split()
for i in range(2):
    if i == 0:
        A = int(N[i])
    elif i == 1:
        B = int(N[i])

X_1 = A + B
X_2 = A - B
X_3 = A * B

max = X_1

if max < X_2:
    max = X_2
if max < X_3:
    max = X_3

print(max)
n=int(input())
x=input()
p=x.count('1')

#popcount(x)が0,1だった場合に対応
if p==0:
    for i in range(n):
        print(1)
    exit()
#elif p==1:
#    z=x.index('1')
#    for i in range(n):
#        if i==z:
#            print(0)
#        else:
#            print(1)
#    exit()

#愚直に解く関数を定義
def solve(n):
    count=0
    while n:
        popcount=bin(n).count('1')
        n%=popcount
        count+=1
    return count

#2^i mod(p+1),2^i mod(p-1)のリストを作成
a,b=[],[]
for i in range(n):
    a.append(pow(2,i,p+1))
    b.append(pow(2,i,p-1))

#x mod(p+1),x mod(p-1)を計算
a1,b1=0,0
for i in range(n):
    if x[-1-i]=='1':
        a1+=a[i]
        b1+=b[i]

#本計算
for i in range(n):
    if x[i]=='1':
        tmp=(b1-b[-1-i])%(p-1)
    else:
        tmp=(a1+a[-1-i])%(p+1)
    print(solve(tmp)+1)

### FIXED CODE ###

n=int(input())
x=input()
p=x.count('1')

#愚直に解く関数を定義
def solve(n):
    count=0
    while n:
        popcount=bin(n).count('1')
        n%=popcount
        count+=1
    return count+1

#popcount(x)が0,1だった場合に対応
if p==0:
    for i in range(n):
        print(1)
    exit()
elif p==1:
    z=x.index('1')
    t=pow(2,n-z-1,p+1)
    for i in range(n):
        if i==z:
            print(0)
        else:
            tmp=(t+pow(2,n-i-1,p+1))%(p+1)
            print(solve(tmp))
    exit()


#2^i mod(p+1),2^i mod(p-1)のリストを作成
a,b=[],[]
for i in range(n):
    a.append(pow(2,i,p+1))
    b.append(pow(2,i,p-1))

#x mod(p+1),x mod(p-1)を計算
a1,b1=0,0
for i in range(n):
    if x[-1-i]=='1':
        a1+=a[i]
        b1+=b[i]

#本計算
for i in range(n):
    if x[i]=='1':
        tmp=(b1-b[-1-i])%(p-1)
    else:
        tmp=(a1+a[-1-i])%(p+1)
    print(solve(tmp))
if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    a.sort()

    dp = [True]*int(1e6)

    for i in a:
        if dp[i*2-1]==False:
            pass
        else:
            for j in range(2, int(len(dp)/i)):
                dp[i*j-1] = False


    count = 0
    for i in set(a):
        if len(set(a))==1:
            break
        if dp[i-1]==True:
            count += 1

    print(count)


### FIXED CODE ###

if __name__ == "__main__":
    n = int(input())
    l_a = list(map(int, input().split()))
    s_a = list(set(l_a))

    #s_a.sort()

    dub_a = [0]*(max(s_a)+1)

    for i in l_a:
        dub_a[i] += 1

    dp = [1]*(max(s_a)+1)

    for i in s_a:
        for j in range(2*i, len(dp), i):
            dp[j] = 0


    count = 0
    for i in s_a:
        if dp[i]==1 and dub_a[i]==1:
            count += 1
    print(count)
import sys

args = sys.argv
S=args[1]
K=int(args[2])
result=0

a=S[0]
renzoku=0
sumInS=0
for s in S:
    if a==s:
        renzoku=renzoku+1
    else:
        sumInS=sumInS+renzoku//2
        renzoku=1
    a=s
sumInS=sumInS+renzoku//2
result = sumInS*K

if S[0]==S[-1]:
    rst=0
    for s in S:
        if s==S[0]:
            rst=rst+1
        else:
            break
    ren=0
    for s in S[::-1]:
        if s==S[-1]:
            ren=ren+1
        else:
            break
    if rst%2==1 and ren%2==1:
        result=result+(K-1)

if renzoku==len(S):
    total=len(S)*K
    result=total//2

print(result)

### FIXED CODE ###

import sys

S=input()
K=int(input())
result=0

a=S[0]
renzoku=0
sumInS=0
for s in S:
    if a==s:
        renzoku=renzoku+1
    else:
        sumInS=sumInS+renzoku//2
        renzoku=1
    a=s
sumInS=sumInS+renzoku//2
result = sumInS*K

if S[0]==S[-1]:
    rst=0
    for s in S:
        if s==S[0]:
            rst=rst+1
        else:
            break
    ren=0
    for s in S[::-1]:
        if s==S[-1]:
            ren=ren+1
        else:
            break
    if rst%2==1 and ren%2==1:
        result=result+(K-1)

if renzoku==len(S):
    total=len(S)*K
    result=total//2

print(result)
#!/usr/bin/env python3
import sys
from math import ceil, floor

def solve(A: int, B: int, C: int, D: int, E: int, F: int):
    
    x = []
    y = []  

    for i in range(ceil(F/(100*A))+1):
        for j in range(ceil(F/(100*B))+1):
            dx = 100*A*i+100*B*j
            if(100*min(A,B) <= dx <= F):
                x.append(dx)

    for i in range(ceil(F/C)+1):
        for j in range(ceil(F/C)+1):
            dy = C*i+D*j
            if(0 <= dy <= F):
                y.append(dy)

    x = sorted(list(set(x)))
    y = sorted(list(set(y)))
    
    w = x[1]
    s = y[1]

    for i in x:
        for j in y:
            de = 100*s/(w+s)
            ne = 100*j/(i+j)
            if(i+j <= F and de < ne <= 100*E/(100+E)):
                # print(i, j, ne)
                w = i
                s = j

    print(w+s, s)

    return


# Generated by 1.1.5 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()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    F = int(next(tokens))  # type: int
    solve(A, B, C, D, E, F)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from math import ceil, floor

def solve(A: int, B: int, C: int, D: int, E: int, F: int):
    
    x = []
    y = []  

    for i in range(ceil(F/(100*A))+1):
        for j in range(ceil(F/(100*B))+1):
            dx = 100*A*i+100*B*j
            if(min(100*A,100*B) <= dx <= F):
                x.append(dx)

    for i in range(ceil(F/C)+1):
        for j in range(ceil(F/C)+1):
            dy = C*i+D*j
            if(0 <= dy <= F):
                y.append(dy)

    x = sorted(list(set(x)))
    y = sorted(list(set(y)))
    
    w = x[0]
    s = y[0]

    for i in x:
        for j in y:
            de = 100*s/(w+s)
            ne = 100*j/(i+j)
            if(i+j <= F and de < ne <= 100*E/(100+E)):
                # print(i, j, ne)
                w = i
                s = j

    print(w+s, s)

    return


# Generated by 1.1.5 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()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    E = int(next(tokens))  # type: int
    F = int(next(tokens))  # type: int
    solve(A, B, C, D, E, F)

if __name__ == '__main__':
    main()
N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]

visited = [False] * N
visited[0] = True
d = {}
for a, b in A:
    d.setdefault(b-1, []).append(a-1)
    d.setdefault(a-1, []).append(b-1)

l = sorted(d.items())

def dfs(v, seen):
    if False not in seen: return 1
    
    c = 0
    for i in d[v]:
        if (seen[i]): continue
        seen[i] = True
        c += dfs(i, seen)
        seen[i] = False
    return c
    
print(dfs(0, visited))



### FIXED CODE ###

N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(M)]

visited = [False] * N
visited[0] = True
d = {}
for a, b in A:
    d.setdefault(b-1, []).append(a-1)
    d.setdefault(a-1, []).append(b-1)

l = sorted(d.items())

def dfs(v, seen):
    if False not in seen: return 1
    
    c = 0
    for i in d[v]:
        if (seen[i]): continue
        seen[i] = True
        c += dfs(i, seen)
        seen[i] = False
    return c
    
print(dfs(0, visited))
n=int(input())
a=input().split()
ans=''
for i in range(1,n+1):
    ans+=str(a.index(str(i))+1)+' '

print(ans)


### FIXED CODE ###

n=int(input())
if n%2==0:
	print(1/2)
else:
  	print((n-(n-1)/2)/n)
### 動的計画法のテーブルを用意
# dp(n) は頂点nを始点として時の最大有効パスの長さ

def get_inputs():
    N, M = map(int, input().split())

    # グラフgを初期化
    g = [[] for _ in range(N)]

    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, input().split())
        g[x].append(y)

    return N, M, g


def getlp(x, depth):
    global dp, g

    if depth >= MAX_DEPTH:
        return -1
    elif dp[x] != -1:
        return dp[x]
    elif len(g[x]) == 0:
        dp[x] = 0
        return dp[x]
    else:
        mxp = 0
        for y in g[x]:
            yp = getlp(y, depth + 1)
            if yp == -1:
                return -1
            elif yp > mxp:
                mxp = yp
        dp[x] = mxp + 1
        return dp[x]


N, M, g = get_inputs()
MAX_DEPTH = 999

dp = [-1] * N
nodes = list(range(N))
ans = 0

while len(nodes) > 0:
    tmp_nodes = []
    for x in range(N):
        if dp[x] == -1:
            t = getlp(x, 0)
            if t == -1:
                tmp_nodes.append(x)
            else:
                ans = max(ans, t)
        else:
            ans = max(ans, dp[x])

    nodes = list(tmp_nodes)

print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)

def get_inputs():
    N, M = map(int, input().split())
    
    # グラフgを初期化
    g = [[] for _ in range(N)]
    
    # 辺情報を読み込みgに追加
    for _ in range(M):
        x, y = map(lambda c: int(c) - 1, input().split())
        g[x].append(y)
    
    return N, M, g


def getlp(x):
    global dp, g
    
    if dp[x] != -1:
        return dp[x]
    elif len(g[x]) == 0:
        dp[x] = 0
        return dp[x]
    else:
        dp[x] = max([getlp(y) for y in g[x]]) + 1
        return dp[x]


N, M, g = get_inputs()

dp = [-1] * N
ans = 0
for x in range(N):
    ans = max(ans, getlp(x))

print(ans)
c=[]
for i in range(3):
    ci=input()
    a.append(ci)
print(c[1][1]+c[2][2]+c[3][3])

### FIXED CODE ###

c=[]
for i in range(3):
    ci=input()
    c.append(ci)
print(c[0][0]+c[1][1]+c[2][2])
N = int(input())
A = list(map(int,input().split()))
O = [i for i in range(N) if(i%2==0 and A[i]%2==1)]
print(len(O))

### FIXED CODE ###

L, R, d = map(int,input().split())
if(L%d != 0):
  print(R//d-L//d)
else:
  print(R//d-L//d + 1)
r = int(input)
print(3r^2)

### FIXED CODE ###

r = int(input())
print(3*r*r)
import sys

input = sys.stdin.readline
A, B = map(int, input().split())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


af = factorization(A)
bf = factorization(B)
ans = 1
for afi in af:
    if afi in bf:
        ans += 1
print(ans)


### FIXED CODE ###

N = int(input())

if N % 2 == 0:
    print('0.5000000000')
else:
    print(round((int(N / 2) + 1) / N, 10))
s = [0] * 13
h = [0] * 13
c = [0] * 13
d = [0] * 13

num = int(input())
for i in range(num):
    m, n = input().split()
    n = int(n)
    if m == "S":
        s[n] = 1
    if m == "H":
        h[n] = 1
    if m == "C":
        c[n] = 1
    if m == "D":
        d[n] = 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" % i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" % i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" % i)

for i in range(1,13):
    if d[i] == 0:
        print("D %d" % i)






### FIXED CODE ###

#
# 6b
#

def main():
    n = int(input())
    c = []
    for i in range(n):
        m, r = input().split()
        r = int(r)
        c.append([m, r])
    for M in ["S", "H", "C", "D"]:
        for R in range(1, 14):
            for i in range(n):
                if c[i] == [M, R]:
                    break
            else:
                print(*[M, R])


if __name__ == '__main__':
    main()
print(3*(int(input()**2))

### FIXED CODE ###

print(3*(int(input())**2))
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

print(lcm(A,B))

### FIXED CODE ###

import fractions

def lcm(x, y):
    ans  =(x * y) // fractions.gcd(x, y)
    return ans

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

print(lcm(A,B))
ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	n=int(raw_input())
	if n+1==0:break
	e=0
	#for i in range(n):
	#	a=ref[int(raw_input())]
	#	print "{:07b}".format(a^e)
	#	e=a

### FIXED CODE ###

ref=[63,6,91,79,102,109,125,39,127,111]
while 1:
	try:
		n=input()
		if n==-1:break
		e=0
		for i in range(n):
			a=ref[input()]
			print "{:07b}".format(a^e)
			e=a
	except:
		pass
N, M, Q = map(int,input().split())
Mlist = [input().split() for l in range(M)]
Qlist = [input().split() for l in range(Q)]
Mlist.sort()
for i in range(len(Mlist)):
    for j in range(len(Mlist[i])):
        Mlist[i][j] = int(Mlist[i][j])
for i in range(len(Qlist)):
    for j in range(len(Qlist[i])):
        Qlist[i][j] = int(Qlist[i][j])
p = [[0 for i in range(N)] for j in range(N)]
q = 0
r = [[0 for i in range(N)] for j in range(N)]
def count(k,l):
    s = k
    j = l
    p[s-1][j-1] = p[s-1][j-1] + 1
for i in range(len(Mlist)):
    count(Mlist[i][0],Mlist[i][1])
for i in range(10):
    for j in range(10):
        r[i][j] = r[i][j-1] + p[i][j]
for i in range(len(Qlist)):
    q = 0
    for j in range(Qlist[i][0],Qlist[i][1]+1):
        q = q + r[j-1][Qlist[i][1]-1]
        if j - 1> 0:
            q = q - r[j-1][j-2]
    print(q)

### FIXED CODE ###

A,B = map(int,input().split())
print(A*B-A-B+1)
n,m = map(int,input().split())
x = [0]*n
y = [0]*n
mx = [0]*m
my = [0]*m
for i in range(n):
    x[i],y[i] = map(int,input().split())
for j in range(m):
    mx[j],my[j] = map(int,input().split())
ans = [0]*n
for k in range(n):
    dis = 1000000000
    cnt = 1
    for l in range(n):
        if abs(x[k]-mx[l])+abs(y[k]-my[l]) < dis:
            dis = abs(x[k]-mx[l])+abs(y[k]-my[l])
            cnt = l+1
    ans[k] = cnt
for h in ans:
    print(h)

### FIXED CODE ###

n,m = map(int,input().split())
student = []
Coodinate = []
for i in range(n):
    student.append(list(map(int,input().split())))
for j in range(m):
    Coodinate.append(list(map(int,input().split())))
ans = []
#print(student)
#print(Coodinate)
for k in student:
    manhattan = 100000000000
    number = 0
    for u in range(m):
        manhattann = abs(k[0]-Coodinate[u][0])+abs(k[1]-Coodinate[u][1])
        if manhattann < manhattan:
            manhattan = manhattann
            number = u+1
    ans.append(number)
for y in ans:
    print(y)
input();print(sum(int(a-1)for i in input().split()))

### FIXED CODE ###

print(sum(i-1for i in list(map(int,open(0).read().split()))[1:]))
n=list(input())
f=0
for i in range(len(n)):
    if(n[i]==n[i+1]):
    	f=1
if(f==1):
	print("Bad")
else:
	print("Good")

### FIXED CODE ###

n=list(input())
f=0
for i in range(len(n)-1):
    if(n[i]==n[i+1]):
        f=1
if(f==1):
    print("Bad")
else:
    print("Good")
from collections import deque
n,k = map(int,input().split())
a = list(map(int,input().split()))
roop_find = deque([0])
i = 0
count = 0
while a[i]-1 not in roop_find:
    roop_find.append(a[i]-1)
    i = a[i] - 1
    count += 1
b = roop_find.index(a[i]-1)
roop = list(roop_find)[b:count+1]

if k < b:
    print(roop_f[k]+1)
else:
    k-=b
    e = k % len(roop)
    print(roop[e]+1)


### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
pos = 0
visit = [0] * n
move = []
loop = []
while visit[pos] != 2:
    if visit[pos] == 0:
        move.append(pos)
    else:
        loop.append(pos)
    visit[pos] += 1
    pos = a[pos] - 1
if len(move) > k:
    print(move[k]+1)
else:
    print(loop[(k-(len(move)-len(loop)))%len(loop)]+1)
N = int(input())
uvw = [list(map(int, input().split())) for i in range(N - 1)]
R = [-1] * N
Q = [[] for i in range(N)]
for i in range(N - 1):
    Q[uvw[i][0] - 1].append([uvw[i][1], uvw[i][2]])
    Q[uvw[i][1] - 1].append([uvw[i][0], uvw[i][2]])

def func(i, s, d, l):
    
    if R[i] != -1:
        return

    if R[i] == -1:
        if l %2 == 0:
            R[i] = s
        else:
            R[i] = d
            s = d
            d = s
    for j in range(len(Q[i])):
        func(Q[i][j][0] - 1, s, d, Q[i][j][1])

func(uvw[0][0] - 1, 0, 1, 0)
print(R)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
N = int(input())
uvw = [list(map(int, input().split())) for i in range(N - 1)]
R = [-1] * N
Q = [[] for i in range(N)]
for i in range(N - 1):
    Q[uvw[i][0] - 1].append([uvw[i][1], uvw[i][2]])
    Q[uvw[i][1] - 1].append([uvw[i][0], uvw[i][2]])

def func(i, s, d, l):
    
    if R[i] != -1:
        return

    if R[i] == -1:
        if l %2 == 0:
            R[i] = s
        else:
            R[i] = d
            tmp = s
            s = d
            d = tmp
    for j in range(len(Q[i])):
        func(Q[i][j][0] - 1, s, d, Q[i][j][1])

func(uvw[0][0] - 1, 0, 1, 0)
for i in range(len(R)):
    print(R[i])
#17:11
n,m = map(int,input().split())
pre = [-1 for i in range(n)]
for _ in range(m):
  x,y,z = map(int,input().split())
  x -= 1
  y -= 1
  X = []
  Y = []
  while pre[x] != -1:
    X.append(x)
    x = pre[x]
  while pre[y] != -1:
    Y.append(Y)
    y = pre[y]
  if x != y:
    if len(X) > len(Y):
      pre[x] = y
      for xx in X:
        pre[xx] = y
      for yy in Y:
        pre[yy] = y
    else:
      pre[y] = x
      for xx in X:
        pre[xx] = x
      for yy in Y:
        pre[yy] = x
father = set()
ans = 0
for i in range(n):
  if pre[i] == -1:
    ans += 1
#print(pre)
print(ans)

### FIXED CODE ###

#解説チラ見
n,m = map(int,input().split())
ans = n
pre = [i for i in range(n)]
for _ in range(m):
  x,y,z = map(lambda x: int(x)-1, input().split())
  X = [x]
  while pre[x] != x:
    x = pre[x]
    X.append(x)
  Y = [y]
  while pre[y] != y:
    y = pre[y]
    Y.append(y)
  if x != y:
    ans -= 1
    for xx in X:
      pre[xx] = y
    for yy in Y:
      pre[yy] = y
    pre[x] = y
print(ans)
O = input()

E = input()

Ans = ""

for i in range(max(len(O),len(E))):
	Ans += O[i]
	Ans += E[i]
	
print(Ans)

### FIXED CODE ###

O = input()

E = input()

Ans = ""

for i in range(len(O)):
	Ans += O[i]
	if i < len(E):
		Ans += E[i]
print(Ans)
input_array = []
while True:
    try:
        input_array.append(input().split())
    except:
        break
for i in input_array:
    print(int(i[0] + i[1]/2))

### FIXED CODE ###

import sys
input = sys.stdin.readline

input_array = []
input_array.append(input().split())

for i in input_array:
    print(int(int(i[0]) + int(i[1])/2))
N = int(input())
rest = []
for i in range(N):
  S,P = input().split()
  inrest = [ i + 1 , str(S) , int(P)]
  rest.append(inrest)

rest = sorted(rest , key = lambda x:x[2] , reverse = True)
rest = sorted(rest , key = lambda x:x[1])

for i in range(N):
  print(lest[i][0])

### FIXED CODE ###

N = int(input())
rest = []
for i in range(N):
  S,P = input().split()
  inrest = [ i + 1 , str(S) , int(P)]
  rest.append(inrest)

rest = sorted(rest , key = lambda x:x[2] , reverse = True)
rest = sorted(rest , key = lambda x:x[1])

for i in range(N):
  print(rest[i][0])
A,B=input().split()
A=int(A)
B=int(B*100)
print(A*B/100)

### FIXED CODE ###

A,B=input().split()
A=int(A)
B=int(B.replace(".",""))*100
print(A*B//10000)
stuck = ""
while True:
    a = raw_input().split()
    if a == "quit"
        break
    if a[0] == "push"
        stuck += a[1]
    elif a[0] == "pop"
        stuck.pop()
for i in range(len(stuck))
    print stuck[i]

### FIXED CODE ###

stuck = ""
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        stuck += a[1]
    elif a[0] == "pop":
        l = len(stuck) - 1
        print stuck[l]
        stuck = stuck[:l]
a = int(input)
ans = a + a*a + a*a*a
print(ans)

### FIXED CODE ###

a = int(input())
ans = a + a*a + a*a*a
print(ans)
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for i in range(M)]
for i in range(M):
  PY[i].append(i)

PY = sorted(PY)
#print(PY)

for i in range(M):
  X = str(PY[i][0])#県の番号
  if i >= 1:#市の番号
    #print(PY)
    if PY[i][0] == PY[i-1][0]:
      Y = int(Y) + 1
    else:
      Y = 1
  else:
    Y = 1
  while len(str(X)) <= 5:#6桁にするための処理
    X = "0" + X
  while len(str(Y)) <= 5:
    Y = "0" + str(Y)
  PY[i][1] = X + Y#文字列の結合
#print(PY)
PY = sorted(PY, key = lambda x:x[2])

for i in range(M):
  print(PY[i][1])

### FIXED CODE ###

N, M = map(int, input().split())
PY = [list(map(int, input().split())) for i in range(M)]
for i in range(M):
  PY[i].append(i)

PY1 = sorted(PY)
#print(PY)

for i in range(M):
  X = str(PY1[i][0])#県の番号
  if i >= 1:#市の番号
    #print(PY)
    if PY1[i][0] == PY1[i-1][0]:
      Y = int(Y) + 1
    else:
      Y = 1
  else:
    Y = 1
  while len(str(X)) <= 5:#6桁にするための処理
    X = "0" + X
  while len(str(Y)) <= 5:
    Y = "0" + str(Y)
  PY1[i][1] = str(X) + str(Y) #文字列の結合
#print(PY)
PY2 = sorted(PY1, key = lambda x:x[2])

for i in range(M):
  print(PY2[i][1])
d,n = map(int, input().split())
x = []

if d == 0 :
  for i in range(1,100):
    x.append(i)
  
elif d == 1 :
  for i in range(1,100):
    x.append(i*100)

elif d == 2 :
  for i in range(1,100):
    x.append(i*10000)

print(x[n-1])

### FIXED CODE ###

d,n = map(int, input().split())
if n==100:
  print(100**d * 101)
else:
  print(100**d * n)
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
    if a[a[i]]==i+1
      cnt+=1
      break
    else:
      cnt=cnt
print(cnt)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
    if a[a[i]-1]==i+1:
      cnt+=1
    else:
      cnt=cnt
print(cnt//2)