Harryxun/stf_run huggingface dataset:
import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
A,B = map(int,input().split())
if A == 1 or B == 1:
    print(1)
else:
    Min = min(A,B)
    pr = primes(Min)
    c = 0
    for i in pr:
        if A%i == 0 and B%i == 0:
            c += 1
    print(c+1)

### FIXED CODE ###

import sys
input=sys.stdin.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
import fractions
A,B = map(int,input().split())
if A == 1 or B == 1:
    print(1)
else:
    def factorization(n): #2以上の整数n => [[素因数, 指数], ...]の2次元リストを返す
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])
        if temp!=1:
            arr.append([temp, 1])
        if arr==[]:
            arr.append([n, 1])
        return arr
    c = fractions.gcd(A,B)
    arr = factorization(c)
    print(len(arr)+1)
A = int(input())
B = int(input())
if A<=9 && B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int,input().split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)
N = int(input())

lN = list(range(1, N+1))
pN = list(range(2, N+1))
pN.append(1)

res = 0
for ln, pn in zip(lN, pN):
    res += (ln%pn)

print(res)

### FIXED CODE ###

N = int(input())
res = ((N-1)*N)//2
print(res)
#ABC149.B
A,B,K = map(int,input().split())
if K<=A:
    print(A-K)
    print(B)
elif A < K and B-K-A =>0:
    print(0)
    print(B-K-A)
else:
    print(0)
    print(0)

### FIXED CODE ###

#ABC149.B
A,B,K = map(int,input().split())
if K<=A:
    print(A-K)
    print(B)
elif A < K and B-(K-A) >=0:
    print(0)
    print(B-(K-A))
elif A <K and B-K-A<0:
    print(0)
    print(0)
N,K = map(int,input().split())

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list))+1]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            i += 1
            ans[j] = use[i]
        mapans = map(str,ans)
        x = int(''.join(mapans))

    print(x)


### FIXED CODE ###

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

D = set(map(int,input().split()))
A = {1,2,3,4,5,6,7,8,9,0}
N_list = [int(c) for c in str(N)]

use = sorted(list(A - D))

ans = [max(use) for i in range(len(N_list))]
mapans = map(str,ans)
x = int(''.join(mapans))
if N == x:
    print(x)
elif N > x:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list)+1)]
    else:
        ans = [use[0] for i in range(len(N_list)+1)]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    print(x)
else:
    if use[0]!= 0:
        ans = [use[0] for i in range(len(N_list))]
    else:
        ans = [use[0] for i in range(len(N_list))]
        ans[0] = use[1]

    mapans = map(str,ans)
    x = int(''.join(mapans))
    j = 0
    i = 0
    while x < N:
        if ans[j] > N_list[j]:
            for k in range(len(ans)-j-1):
                ans[k] = min(use)
        elif ans[j] == N_list[j]:
            i = 0
            j+=1
        else:
            i += 1
            ans[j] = use[i]
        mapans = map(str,ans)
        x = int(''.join(mapans))

    print(x)
hoge = input().split()
N = int(hoge[0])
L = int(hoge[1])

if L > 0:
  erase_apple = 0
elif L+N >= 0:
  for i in range(N):
    if i + L == 0:
      erase_apple = i
      break
else:
  erase_apple = N-1
  
apples = []
for i in range(N):
  apples.append(L+i)

apples.pop(erase_apple)
print(sum(apples))

### FIXED CODE ###

hoge = input().split()
N = int(hoge[0])
L = int(hoge[1])

if L > 0:
  erase_apple = 0
elif L+N >= 0:
  for i in range(N+1):
    if i + L == 0:
      erase_apple = i
      break
else:
  erase_apple = N-1

if erase_apple == N:
  erase_apple = N-1

apples = []
for i in range(N):
  apples.append(L+i)

apples.pop(erase_apple)
print(sum(apples))
n = int(input())
s1 = []
t1 = []
for in range(n):
  d = map(in,input().split())
  s1.append(d[0])
  t1.append(d[1])
print(sum(t1[s1.index(input()):]))

### FIXED CODE ###

n = int(input())
s1 = []
t1 = []
for i in range(n):
  d =list( map(str,input().split()))
  s1.append(d[0])
  t1.append(int(d[1]))
print(sum(t1[s1.index(input())+1:]))
from collections import Counter
n = int(input())
for _ in range(n):
  word = ''.join(sort(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(word_counter.values()) - n)


### FIXED CODE ###

from collections import Counter
n = int(input())
word_l = list()
for _ in range(n):
  word = ''.join(sorted(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(map(lambda x: sum(range(x)), word_counter.values()))))
n,k,x,y=[int(i) for i in input().split()]
print(min(n,k)*x+max(0,n-k)*y)

### FIXED CODE ###

n,k,x,y=[int(input()) for i in range(4)]
print(min(n,k)*x+max(0,n-k)*y)
import copy
from collections import deque
sima = [list(input()) for i in range(10)]
riku = 0
ikisaki = [(1,0),(-1,0),(0,1),(0,-1)]

for i in range(10):
    for j in range(10):
        if sima[i][j] == "o":
            riku += 1

for i in range(10):
    for j in range(10):
        if sima[i][j] == "o":
            continue
        cou = 0
        karisima = copy.deepcopy(sima)
        karisima[i][j] = "o"
        d = deque()
        d.append((i,j))
        tansaku = [[True for p in range(10)] for q in range(10)]
        while d:
            y , x = d.popleft()
            tansaku[y][x] = False
            cou += 1
            for ney , nex in ikisaki:
                if 0 <= x + nex <= 9 and 0 <= y + ney <= 9:
                    if tansaku[y+ney][x+nex] and karisima[y+ney][x+nex] == "o":
                        d.append((y+ney,x+nex))
        if cou == riku + 1:
            print("YES")
            exit()
print("NO")

### FIXED CODE ###

from bisect import bisect_left,bisect
s = list(input())
sn = len(s)
t = list(input())
tn = len(t)
kouho = []
for i in range(26):
    kar = []
    now = chr(ord('a') + i)
    for j in range(sn):
        if s[j] == now:
            kar.append(j)
    kouho.append(kar)

cou = 0
now = -1
for i in range(tn):
    u = ord(t[i])-ord("a")
    if kouho[u]:
        tugi = bisect(kouho[u],now)
        if tugi == len(kouho[u]):
            cou += 1
            now = kouho[u][0]
        else:
            now = kouho[u][tugi]
    else:
        print(-1)
        exit()

print(cou*sn + now + 1)
h,w=map(int,input().split())
ans=h*w
if h>2:
    t=[h//3*w,(h-(h//3))//2*w,(h-(h//3)+1)//2*w]
    t.sort()
ans=min(ans,t[2]-t[0])
if w>2:
    t=[w//3*h,(w-(w//3))//2*h,(w-(w//3)+1)//2*h]
    t.sort()
ans=min(ans,t[2]-t[0])
a,b=h,w
for i in range(max(1,3//a-1),min(a//2+1,a-1)):
    t=[i*b,(a-i)*(b//2),(a-i)*((b+1)//2)]
    t.sort()
    ans=min(ans,t[2]-t[0])
a,b=w,h
for i in range(max(1,3//a-1),min(a//2+1,a-1)):
    t=[i*b,(a-i)*(b//2),(a-i)*((b+1)//2)]
    t.sort()
    ans=min(ans,t[2]-t[0])
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

h,w=map(int,input().split())
ans=h*w
if h*w%3==0:
    print(0)
else:
    for x,y in ((h,w),(w,h)):
        x1=x//3
        x2=(x+2)//3
        y1=y//2
        y2=(y+1)//2
        ans=min(ans,abs(y*x2-y*x1))
        t=(y*x1,y2*(x-x1),(y-y2)*(x-x1))
        ans=min(ans,max(t)-min(t))
        t=(y*x2,y2*(x-x2),(y-y2)*(x-x2))
        ans=min(ans,max(t)-min(t))
    print(ans)
n = int(input())

import math
def prime(n):
  a = math.ceil(sqrt(n))
  for i in range(2,a):
    if n%i==0: return 1
  return 0

while (1):
  n += 1
  if prime(n)==1: 
    print(n)
    exit()

### FIXED CODE ###

n = int(input())

import math
def prime(n):
  a = math.ceil(math.sqrt(n))
  for i in range(2,a):
    if n%i==0: return 1
  return 0

while (1):
  if prime(n)==0: 
    print(n)
    exit()
  n+=1
s=list(input())
t=list(input())
sv=sorted(s)
tv=sorted(t)
if sv<tv:
    print('Yes')
else:
    print('No')
    

### FIXED CODE ###

#82
a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))
h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = i + dx
            ny = j + dy
            if nx < 0 or nx >= w:
                continue
            if ny < 0 or ny >= h:
                continue
            if s[nx][ny] == '#':
                break
        else:
            print('No')
            exit()

print('Yes')

### FIXED CODE ###

#!/usr/bin/python3

h, w = map(int, input().split())
s = [input() for i in range(h)]

ns = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(h):
    for j in range(w):
        if s[i][j] != '#':
            continue
        for dx, dy in ns:
            nx = j + dx
            ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:
                if s[ny][nx] == '#':
                    break
        else:
            print('No')
            exit()

print('Yes')
s = input()

for i in range(1, 4):
  c = "R" * i
  if c in s:
    ans = i
    
print(ans)
  


### FIXED CODE ###

s = input()
 
if 'RRR' in s:
  i = 3
elif 'RR' in s:
  i = 2
elif 'R' in s:
  i = 1
else:
  i = 0
print(i)
s = input()
p = input()
if s in (p**2):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s,p = input()*2,input()
print('Yes' if p in s else 'No')
t=list(map(int,input().split()))
a=list(map(int,input().split()))
b=list(map(int,input().split()))
p,q=[0],[0]
x,y=[(a[0]-b[0])*t[0],(a[1]-b[1])*t[1]]
#print(x,y,abs(x)<abs(y))
#exit()
if x+y==0:
    print("infinity")
elif (x<0 and y<0) or (x>0 and y>0):
    print(0)
elif (x<0 and x+(x+y)>0) or (x>0 and x+(x+y)<0):
    print(1)
elif x<0 and x+y>0:
    print((abs(x)//(x+y))*2+[0,1][abs(x)%(x+y)>0])
elif x<0 and x+y<0:
    print((y//abs(x+y))*2)
elif x>0 and x+y<0:
    print((x//abs(x+y))*2+[0,1][x%abs(x+y)>0])
#elif x>0 and x+y>0:
#    print((abs(y)//(x+y))*2)
else:
    print(hhh)


### FIXED CODE ###

T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
 
P = (A1 - B1) * T1
Q = (A2 - B2) * T2
if P > 0:
	P *= -1
	Q *= -1
 
if P + Q < 0:
	print(0)
elif P + Q == 0:
	print("infinity")
else:
	S = (-P) // (P + Q)
	T = (-P) % (P + Q)
	if T != 0:
		print(S * 2 + 1)
	else:
		print(S * 2)
h,w,a,b=map(int,input().split())
if h==1:
    print('0'*a+'1'*(w-a))
elif w==1:
    for _ in [0]*a:
        print(0)
    for _ in [0]*(n-a):
        print(1)
elif h%a!=0 or w%b!=0 or h//a!=w//b:
    print('No')
else:
    ans=[[0]*w for _ in [0]*h]
    for i in range(h):
        for j in range(b*(i//a),b*(i//a)+b):
            ans[i][j]=1
    for x in ans:
        print(*x,sep='')

### FIXED CODE ###

h,w,a,b=map(int,input().split())
for _ in [0]*b:
    print('0'*a+'1'*(w-a))
for _ in [0]*(h-b):
    print('1'*a+'0'*(w-a))
A,B,C = map(int, input().strip().split(' '))
K = int(input().strip())

print(sum(A,B,C)+max(A,B,C)*((2**K)-1))


### FIXED CODE ###

A,B,C = map(int, input().strip().split(' '))
K = int(input().strip())

print(A+B+C+max(A,B,C)*((2**K)-1))
import numpy as np
N=int(input())
A=np.array([int(c) for c in input().split()])
AP=A[A>=0]
AN=A[A<0]
if(len(AN)%2==1):
  print(max(-sum(AN)+2*max(AN)+sum(AP),-sum(AN)-2*min(AP)+sum(AP)))
else:
  print(-sum(AN)+sum(AP))
  

### FIXED CODE ###

N=int(input())
A=[int(c) for c in input().split()]

#どうするか
#-1 -1  1
# 1 -1 -1
#-1  1 -1

#偶数個の数値を自由に反転できるとして見ていい

positive=[]
negative=[]
for a in A:
	if(a>=0):
		positive.append(a)
	else:
		negative.append(a)
if(len(negative)%2==0):#偶数個なら全部ひっくり返せばいい
	print(sum(positive)-sum(negative))
else:#奇数個なら, もっとも大きなもの以外をひっくり返す
	#あるいは, 最後にpositive最小とnegative最大をひっくり返すこともありうる	
	if(len(positive)==0):
		print(-sum(negative)+2*max(negative))
	
	else:
		max_nega=max(negative)
		min_posi=min(positive)
		if(-1*max_nega>min_posi):
			print(sum(positive)-sum(negative)-2*min_posi)
		else:	
			print(sum(positive)-sum(negative)+2*max_nega)
n,m=map(int,input().split())
a = list(map(int, input().split()))

import math
ans = a[0]
for i in range(1,n):
    ans = ans * a[i] // math.gcd(ans, a[i])


b = [int(i/2) for i in a]
ans2= b[0]
for i in range(1,n):
    ans2 = ans2 * b[i] // math.gcd(ans2, b[i])


if ans2>m:
    print(000)
else:
    print((m-ans2)//ans+1)

### FIXED CODE ###

import fractions,sys

n,m=map(int,input().split())
a = list(map(int, input().split()))
# ans = a[0]
# for i in range(1,n):
#     ans = ans * a[i] // fractions.gcd(ans, a[i])
ff=[]
for j in  a:
    count=0
    for i in range(1,36):
        if j%(2**i)==0:
            count+=1
    ff.append(count)
ff=[i==ff[0] for i in ff]

 
b = [int(i/2) for i in a]
# b_list=[i%4==0 for i in b]
# bb=sum(b_list)
# if bb!=0 and bb!=n:
if all(ff)==False:
    print(0)
    exit()

ans2= b[0]
for i in range(1,n):
    ans2 = ans2 * b[i] // fractions.gcd(ans2, b[i])

# tf=[(ans2/i)%2==0 for i in b]
# and any(tf)
if ans2>m:
    print(0)
else:
    print((m-ans2)//(ans2*2)+1)
n, k = list(map(int, input().split()))

s = input()

s2 = list(s[:k - 1] + s[k -1].lower + s[k:])
print(s2)


### FIXED CODE ###

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

print(s[:k-1]+s[k-1].lower()+s[k:])
from math import floor
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floor(n / min(a)) + 5) 


### FIXED CODE ###

import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
miti=[a,b,c,d,e]
mini=min(miti)
retu=math.ceil(n/mini)
print(4+retu)
N, K = map(int, input().split())
    p = list(map(int,input().split()))
    ans = 0
    cum = [0]
     
    for i in range(len(p)):
        ex = (1 + p[i])/2
        p[i] = ex
        
    for i in  range(len(p)):
        cum.append(p[i] + cum[i])
        
    for i in range(K, N+1):
        ans  = max(ans, cum[i] - cum[i-K])
     
    print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int,input().split()))
ans = 0
cum = [0]
     
for i in range(len(p)):
    ex = (1 + p[i])/2
    p[i] = ex
        
for i in  range(len(p)):
    cum.append(p[i] + cum[i])
        
for i in range(K, N+1):
    ans  = max(ans, cum[i] - cum[i-K])
     
print(ans)
s=input()
num=0
a=[]
for i in s:
    if i=="R":
        num+=1
    elif i!="R":
        a.append(num)
        num=0
print(max(a))

### FIXED CODE ###

s=input()
num=0
a=[0]
for i in s:
    if i=="R":
        num+=1
        a.append(num)
    else:
        num=0
print(max(a))
while True:

    W,H = tuple(map(int,input().split()))
    if W==0 & H==0:
        break
    for i in range(W):
        print("#"*H)
    |

### FIXED CODE ###

while True:

    W,H = tuple(map(int,input().split()))
    if W==0 & H==0:
        break
    for i in range(W):
        print("#"*H)
    print("")
n,a,b=map(int,input().split())
mod = 1000000007
ans = pow(2,n,mod) - 1

def solve(nu):
    res = 1
    for i in range(nu):
        res *= n-i
    for i in range(nu):
        res/=i+1
    res%=mod
    return res

ans -=solve(a)
ans %= mod
ans -= solve(b)
ans %= mod

print(ans)

### FIXED CODE ###

n,a,b=map(int,input().split())
mod = 1000000007
ans = pow(2,n,mod) - 1

def solve(nu):
    res = 1
    for i in range(nu):
        res *= n-i
        res %= mod
        res *= pow(i+1,mod-2,mod)
        res%=mod
    return res

ans -=solve(a)
ans %= mod
ans -= solve(b)
ans %= mod

print(ans)
print(3*(input()**2))


### FIXED CODE ###

print(3*(int(input())**2))
d = {'A': 'T', 'C': 'D', 'T': 'A', 'D': 'C'}
b = input()
print(d[b])

### FIXED CODE ###

s = input()
ans = ''
if s == 'A':
    ans = 'T'
elif s == 'T':
    ans = 'A'
elif s == 'C':
    ans= 'G'
elif s == 'G':
    ans = 'C'

print(ans)
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

import numpy as np

R, C, K = rl()
#I = [[0]*(C+2) for _ in range(R+2)]
I = np.zeros([R+2, C+2], dtype=int)
for i in range(K):
	r, c, v = rl()
	I[r][c] = v
 
#dp = [[[0 for _ in range(C+2)] for _ in range(R+2)] for _ in range(4)]
dp = np.zeros([4,R+2,C+2], dtype=int)

for i in range(R+1):
	for j in range(C+1):
		for m in range(4):
			ni, nj = i, j+1
			dp[m][ni][nj] = max(dp[m][ni][nj], dp[m][i][j])
			if m < 3:
				dp[m+1][ni][nj] = max(dp[m+1][ni][nj], dp[m][i][j]+I[ni][nj])
			ni, nj = i+1, j
			dp[0][ni][nj] = max(dp[0][ni][nj], dp[m][i][j])
			dp[1][ni][nj] = max(dp[1][ni][nj], dp[m][i][j]+I[ni][nj])
ans = 0
for m in range(4):
	ans = max(ans, dp[m][R][C])
print(ans)


### FIXED CODE ###

import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)
 
R, C, K = rl()
I = [[0]*(C+2) for _ in range(R+2)]
for i in range(K):
	r, c, v = rl()
	I[r][c] = v
 
dp = [[0]*4 for _ in range(C+2)]
dp2 = [[0]*4 for _ in range(C+2)]
 
for i in range(R+1):
	for j in range(C+1):
		for m in range(4):
			ni, nj = i, j+1
			dp[nj][m] = max(dp[nj][m], dp[j][m])
			if m < 3:
				dp[nj][m+1] = max(dp[nj][m+1], dp[j][m]+I[ni][nj])
			ni, nj = i+1, j
			dp2[nj][0] = max(dp2[nj][0], dp[j][m])
			dp2[nj][1] = max(dp2[nj][1], dp[j][m]+I[ni][nj])
	dp = dp2
	dp2 = [[0]*4 for _ in range(C+2)]
ans = 0
for m in range(4):
	ans = max(ans, dp[C][m])
print(ans)
N=int(input())
lst=[int(i) for i in input().split()]
import numpy
res=numpy.cumsum(lst)
ans=10e10
for i in range(N):
  ans=min(ans,abs(res[i]-(res[-1]-res[i]))
print(ans)
  

### FIXED CODE ###

N=int(input())
lst=[int(i) for i in input().split()]
import numpy
res=numpy.cumsum(lst)
ans=10e20
for i in range(N-1):
  ans=min(ans,abs(res[i]-(res[-1]-res[i])))
print(ans)
a, b = int(input())
print(a*b)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
N = int(input())
a = list(map(int, input().split()))

b = {}
ans = 0
for i, v in enumerate(a):
    if v > i+1:
        b[i+1] = v
    elif v < i+1:
        if b[v] == i+1:
            ans += 1
print(ans)


### FIXED CODE ###

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

b = {}
ans = 0
for i, v in enumerate(a):
    if v > i+1:
        b[i+1] = v
    elif v < i+1:
        if v in b and b[v] == i+1:
            ans += 1
print(ans)
from collections import deque

X = input()

ret = deque([X[0]])
for i in range(1, len(X)):
    x = X[i]
    if x == 'S':
        ret.append(x)
    else:
        if ret[-1] == 'S':
            ret.pop()
        else:
            ret.append(x)
print(len(ret))


### FIXED CODE ###

from collections import deque

X = input()

ret = deque([X[0]])
for i in range(1, len(X)):
    x = X[i]
    if x == 'S':
        ret.append(x)
    else:
        if len(ret) > 0 and ret[-1] == 'S':
            ret.pop()
        else:
            ret.append(x)
print(len(ret))
abcd = list(map(int,input().split()))
x = []
y = []
z = []
x = [1] * abcd[0]
y = [0] * abcd[1]
z = [-1] * abcd[2]
x.extend(y)
x.extend(z)
num = 0
for i in range(abcd[3]):
    num += x[i]
print(num)

### FIXED CODE ###

n = input()
a = input()
if n in a:
    if len(n)+1 == len(a):
        if n[0] == a[0]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
#depth first
N=int(input())
V=[]
a=[0]
for i in range(N):
    V.append([int(i) for i in input().split()])
    w=V[i][2:]
    w.sort()
    V[i]=V[i][:2]+w
    a.append(0)
V=sorted(V,key=lambda x:x[0])
c=1
t=1
i=0
r=[1]
a[1]=1
p=[[1,t]]
q=[]
while t<N*2-1:
    j=2
    while t<N*2-1 and j-2<V[i][1] and V[i][1]>0 and a[V[i][j]]==1:
        j+=1
    t+=1
    if j-2<V[i][1]:
        a[V[i][j]]=1
        c+=1
        r.append(V[i][j])
        p.append([V[i][j],t])
        i=V[i][j]-1
    else:
        q.append(p[-1]+[t])
#end time immediately case?
        r.pop(-1)
        p.pop(-1)
        i=r[-1]-1
       # print(q)
q.append([1,1,N*2])
q=sorted(q,key=lambda x:x[0])
for i in range(N):
    for j in range(3):
        q[i][j]=str(q[i][j])
    print(" ".join(q[i]))

### FIXED CODE ###

   #depth first
N=int(input())
V=[]
a=[0]
for i in range(N):
    V.append([int(i) for i in input().split()])
    w=V[i][2:]
    w.sort()
    V[i]=V[i][:2]+w
    a.append(0)
V=sorted(V,key=lambda x:x[0])
c=1
t=1
i=0
r=[1]
a[1]=1
p=[[1,t]]
q=[]
while t<N*2:
    j=2
    while t<N*2 and j-2<V[i][1] and V[i][1]>0 and a[V[i][j]]==1:
        j+=1
    t+=1
    if j-2<V[i][1]:
        a[V[i][j]]=1
        c+=1
        r.append(V[i][j])
        p.append([V[i][j],t])
        i=V[i][j]-1
    else:
        q.append(p[-1]+[t])
        r.pop(-1)
        p.pop(-1)
        if len(r)>0:
            i=r[-1]-1
        else:
            j=1
            while j<N and a[j]==1:
                j+=1
            if j<N:
                t+=1
                i=j-1
                r.append(j)
                p.append([j,t])
q=sorted(q,key=lambda x:x[0])
for i in range(N):
    for j in range(3):
        q[i][j]=str(q[i][j])
    print(" ".join(q[i]))
A, B, N = map(int, input().split())
Ymax=0
if A*N < B:
  print(0)
else:
  x = B-1
  Ymax = A*x//B - A*(x//B)
  print(Ymax)

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
flag=0
for i in range(A,B+1):
  if i%K==0:
    print('OK')
    flag=1
    break
if flag==0:
	print('NG')
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
    ans=m+n
else:
    numa=[0]
    numb=[0]
    for i in range(n):
        numa.append(numa[-1]+a[i])
    for j in range(m):
        numb.append(numb[-1]+b[i])
    ans=0
    for i in range(n+1):
        if numa[i]>k:
            break
        while numb[m]>k-numa[i]:
            m-=1
        ans=max(ans,i+m)
print(ans)


### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
    ans=m+n
else:
    numa=[0]
    numb=[0]
    for i in range(n):
        numa.append(numa[-1]+a[i])
    for j in range(m):
        numb.append(numb[-1]+b[j])
    ans=0
    for i in range(n+1):
        if numa[i]>k:
            break
        while numb[m]>k-numa[i]:
            m-=1
        ans=max(ans,i+m)
print(ans)