Harryxun/stf_run huggingface dataset:
N,V = list(map(int,input().split()))
from collections import deque
listA = list(map(int,input().split()))
listB = deque()
max_number = 0
total = 0
for i in range(N-V+1):
    listB.append(sum(listA[i:i+V]))
max_number = listB.index(max(listB))
for i in listA[max_number:max_number+V]:
    total += (1+i) * (i/2) / i
print(total)

### FIXED CODE ###

N,M=list(map(int,input().split()))
l_n=list(map(int,input().split()))
k=[]
j=0
for i in range(1,1001):
   j+=i
   k.append(j/i)
l_n=[k[l_n[i]-1] for i in range(N)]
ans=sum(l_n[0:M])
sum_n=ans
for i in range(N-M):
   sum_n+=l_n[i+M]
   sum_n-=l_n[i]
   ans=max(ans,sum_n)
print(ans)
h = x
for i in range (1,10):
for j in range (1,10):
print(i, h, j, i*j)



### FIXED CODE ###

print ("1x1=1")
print ("1x2=2")
print ("1x3=3")
print ("1x4=4")
print ("1x5=5")
print ("1x6=6")
print ("1x7=7")
print ("1x8=8")
print ("1x9=9")
print ("2x1=2")
print ("2x2=4")
print ("2x3=6")
print ("2x4=8")
print ("2x5=10")
print ("2x6=12")
print ("2x7=14")
print ("2x8=16")
print ("2x9=18")
print ("3x1=3")
print ("3x2=6")
print ("3x3=9")
print ("3x4=12")
print ("3x5=15")
print ("3x6=18")
print ("3x7=21")
print ("3x8=24")
print ("3x9=27")
print ("4x1=4")
print ("4x2=8")
print ("4x3=12")
print ("4x4=16")
print ("4x5=20")
print ("4x6=24")
print ("4x7=28")
print ("4x8=32")
print ("4x9=36")
print ("5x1=5")
print ("5x2=10")
print ("5x3=15")
print ("5x4=20")
print ("5x5=25")
print ("5x6=30")
print ("5x7=35")
print ("5x8=40")
print ("5x9=45")
print ("6x1=6")
print ("6x2=12")
print ("6x3=18")
print ("6x4=24")
print ("6x5=30")
print ("6x6=36")
print ("6x7=42")
print ("6x8=48")
print ("6x9=54")
print ("7x1=7")
print ("7x2=14")
print ("7x3=21")
print ("7x4=28")
print ("7x5=35")
print ("7x6=42")
print ("7x7=49")
print ("7x8=56")
print ("7x9=63")
print ("8x1=8")
print ("8x2=16")
print ("8x3=24")
print ("8x4=32")
print ("8x5=40")
print ("8x6=48")
print ("8x7=56")
print ("8x8=64")
print ("8x9=72")
print ("9x1=9")
print ("9x2=18")
print ("9x3=27")
print ("9x4=36")
print ("9x5=45")
print ("9x6=54")
print ("9x7=63")
print ("9x8=72")
print ("9x9=81")
from sys import stdin
n,m,k = map(int, stdin.readline().rstrip().split())
a = list(map(int, stdin.readline().rstrip().split()))
b = list(map(int, stdin.readline().rstrip().split()))

A = [0]
B = [0]
ans = 0
for i in range(0, n):
    A.append(A[i]+a[i])
for i in range(0, m):
    B.append(B[i]+b[i])

for i in range(0,n):
    j = 0
    while A[i] + B[j+1] <= k:
        j += 1
    ans = max(ans, i + j)
print(ans)

### FIXED CODE ###

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

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


a_pre,b_pre=[0],[0]

for i in range(n):
	a_pre.append(a_pre[i]+a[i])

for i in range(m):
	b_pre.append(b_pre[i]+b[i])

ans,j=0,m
for i in range(n+1):
	if a_pre[i]>k:
		break
	while b_pre[j]>k-a_pre[i]:
		j-=1

	ans=max(ans,i+j)

print(ans)
s = str(int(input()))
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')


### FIXED CODE ###

s = str(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
length, index = map(int, input().split())
string = list(input())
string = replace(string[index],string[index].lower())
print(string.join())

### FIXED CODE ###

N, change = map(int, input().split())
string = list(input())
string[change-1] = string[change-1].lower()
print(''.join(string))
import numpy as np

N, H = map(int, input().split())
AB = [list(map(int,input().split())) for i in range(N)]

swing = sorted([AB[i][0] for i in range(N)], reverse=True)
throw = sorted([AB[i][1] for i in range(N)], reverse=True)

## 投げて強いものは（最後に）投げる
big_throw = [throw[i] for i in range(N) if throw[i] > swing[0]]
throw_cumsum = np.array(big_throw).cumsum()
for i in range(len(big_throw)):
  if H - throw_cumsum[i] <= 0:
    print(i+1)
    exit()
else:
  cnt = len(throw_cumsum)
  H -= throw_cumsum[-1]

## 残りは全部（最初に）切る
cnt += ((H + (swing[0]-1)) // swing[0])
print(cnt)

### FIXED CODE ###

import numpy as np

N, H = map(int, input().split())
AB = [list(map(int,input().split())) for i in range(N)]

swing = sorted([AB[i][0] for i in range(N)], reverse=True)
throw = sorted([AB[i][1] for i in range(N)], reverse=True)

cnt = 0

if throw[0] > swing[0]:  ## 投げて強いものは（最後に）投げる
  big_throw = [throw[i] for i in range(N) if throw[i] > swing[0]]
  throw_cumsum = np.array(big_throw).cumsum()
  for i in range(len(big_throw)):
    if H - throw_cumsum[i] <= 0:
      print(i+1)
      exit()
  else:
    cnt += len(throw_cumsum)
    H -= throw_cumsum[-1]

## 残りは全部（最初に）切る
cnt += ((H + (swing[0]-1)) // swing[0])
print(cnt)
N,M=map(int,input().split())
lst=[[] for _ in range(M)]
for i in range(M):
  lst[i]=list(map(int,input().split()))
ans=0
visited=[]
ini=lst.pop(0)
tmp=[i for i in range(ini[0],ini[1]+1)]

def f(tmp):
  if len(lst)==0:
    return len(tmp)
  else:
    l=lst.pop(0)
    v1,v2=l[0],l[1]
    if tmp==[]:
      return 0
    else:
      m1=v1
      M1=v2
      m2=min(tmp)
      M2=max(tmp)
      m,M=max(m1,m2),min(M1,M2)
      tmp=[i for i in range(m,M+1)]
      return f(tmp)
    
print(f(tmp))

### FIXED CODE ###

N,M=map(int,input().split())
lst=[[] for _ in range(M)]
dif=10**19
v1,v2=map(int,input().split())
for i in range(M-1):
  v_1,v_2=map(int,input().split())
  v1,v2=max(v1,v_1),min(v2,v_2)
if v2-v1+1<=0:
  print(0)
else:
  print(v2-v1+1)
n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n):
  for j in range(n):
      if 10000*i + 5000*j + 1000*k == y and i+j+k == n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)

### FIXED CODE ###

n, y =  map(int, input().split())
 
res_a = -1
res_b = -1
res_c = -1
 
for i in range(n+1):
  for j in range(n+1):
      if 10000*i + 5000*j + 1000*(n-i-j) == y and i+j <= n:
        res_a, res_b, res_c = i, j, n-i-j
        break
        
print(res_a, res_b, res_c)
(n, m, l) = map(int, raw_input().split())

A = []
for i in xrange(0,n):
	line_A = map(int, raw_input().split())
	A.append(line_A)

B = []
for j in xrange(0,m):
	line_B = map(int, raw_input().split())
	B.append(line_B)

C = []
for x in xrange(0,n):
	temp_list = []
	for y in xrange(0,l):
		temp = 0
		for z in xrange(0,m):
			temp = temp + A[x][z] * B[z][y]

		temp_list.append(temp)
		
	C.append(temp_list)
	temp_list = []
			

for k in xrange(0,n):
	if k > 0:
		print
	for h in xrange(0,l):

### FIXED CODE ###

(n, m, l) = map(int, raw_input().split())

A = []
for i in xrange(0,n):
	line_A = map(int, raw_input().split())
	A.append(line_A)

B = []
for j in xrange(0,m):
	line_B = map(int, raw_input().split())
	B.append(line_B)

C = []
for x in xrange(0,n):
	temp_list = []
	for y in xrange(0,l):
		temp = 0
		for z in xrange(0,m):
			temp = temp + A[x][z] * B[z][y]

		temp_list.append(temp)
		
	C.append(temp_list)
	temp_list = []
			

for k in xrange(0,n):
	if k > 0:
		print
	for h in xrange(0,l):
		print C[k][h],
print
N = int(input())
S = str(input())

ans = 0
for i in range(1000):
    n = f"{i:03}"
    index = 0
    c = 0
    for k in n:
        for j in range(index, len(S)):
            if S[j] == k:
                index = j+1
                c+=1
                break
    if c == 3:
        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
S = str(input())

ans = 0
for i in range(1000):
    n = "{:03}".format(i)
    index = 0
    c = 0
    for k in n:
        for j in range(index, N):
            if S[j] == k:
                index = j+1
                c+=1
                break
    if c == 3:
        ans += 1
print(ans)
p=[1]*10001

i=2
while i*i<10000:
    if p[i]:
        j=i+i
        while j<10000:
            p[j]=0
            j+=i
    i+=1
count=0
for i in range(int(input())):
    if p[int(input())]==1:
        count+=1
        
print(count)


### FIXED CODE ###

def is_prime(n):
    i=2
    while i*i<=n:
        if n%i==0:
            return False
        i+=1
    return True
    
s=[]
for _ in range(int(input())):
    s.append(is_prime(int(input())))
print(sum(s))
n = int(input())

v = 1
for i in range(n):
  v = v*(i+1)
  
print(int(v%(1e9+7)))


### FIXED CODE ###

n = int(input())

v = 1
for i in range(n):
  v = v*(i+1)
  if v >= 1e9+7:
    v = v%(int(1e9)+7)
  
print(v)
n=input()
v=list(map(int, input().split()))
c=list(map(int, input().split()))
for i in range(n)
t[i]=v[i]-c[i]
a=0
for i in range(n)
if t[i]>0 :
a+=t[i]
print(a)

### FIXED CODE ###

a,b,t = map(int,input().split())
print(b*(t//a))
cnt = 0
n = int(input())
cnt = 0

def rec(int pref):
	if pref <= n:
		cnt += 1
		for d in {3, 5, 7}:
			rec(pref * 10 + d)


rec(0)
print(cnt - 1)


### FIXED CODE ###

n = int(input())
cnt = 0

def rec(pref):
	global cnt
	if pref <= n:
		s = str(pref)
		if '3' in s and '5' in s and '7' in s:
			#print(pref)
			cnt += 1
		for d in {3, 5, 7}:
			rec(pref * 10 + d)


rec(0)
print(cnt)
S = int(input())
S500 = S/500
S5 = (S%500)/5
print(1000*S500 + 5*S5)

### FIXED CODE ###

S=input()
if (S[2]==S[3]) and (S[4]==S[5]):
    print('Yes')
else:
    print('No')
N = int(input())

q = 0
res = []
for i in range(20):
    print(q)
    s = input()
    if s[0] == 'V':
        exit()
    res.append((q,s[0]))
    if len(res) == 1:
        q = N//2
        continue
    for (i1,g1),(i2,g2) in zip(res,res[1:]):
        if (i2-i1)%2 == int(g1==g2):
            q = (i2-i1)//2
            break
    else:
        q = (res[-1][0] + N + 1)//2

    print(res)


### FIXED CODE ###

N = int(input())

q = 0
res = []
for i in range(20):
    print(q)
    s = input()
    if s[0] == 'V':
        exit()
    res.append((q,s[0]))
    res.sort()
    if len(res) == 1:
        q = N//2
        continue
    for (i1,g1),(i2,g2) in zip(res,res[1:]):
        if i2-i1 == 1: continue
        if (i2-i1)%2 == int(g1==g2):
            q = (i2+i1)//2
            break
    else:
        q = (res[-1][0] + N + 1)//2
a = int(input())
found = False
for i in range(1, 10):
  for j in range(1, 10):
    if i*j == a:
	  found = True
if found:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = int(input())
found = False
for i in range(1, 10):
  for j in range(1, 10):
    if i*j == a:
      found = True
if found:
  print("Yes")
else:
  print("No")
c = [list(input().split()) for _ in range(2)]
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
    print('YES')
else: 
    print('No')

### FIXED CODE ###

c = [list(input()) for _ in range(2)]
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
    print('YES')
else: 
    print('NO')
W,H,x,y,r=map(int,input().split())

if W<(x+r):
    print(No)
elif H<(y+r):
    print(No)
else:
    print(Yes)

### FIXED CODE ###

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

if W>=(x+r) and r<=x:
 if H>=(y+r) and r<=y:
  print('Yes')
 else:
  print('No')
else:
 print('No')
N, M= map(int, input().split())

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) >= M:
    print('Yes')
else:
    print('No')

### FIXED CODE ###


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

C = map(int, input().split())

A = list(C)

#if N < M:
#    print('No')
#if M == 0:
#    print('No')

B = []
for i in range(len(A)):
    if A[i] >= sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) >= M:
    print('Yes')
else:
    print('No')
A,B,C = map(int,input().split())
L = sorted[A,B,C]
print(10*L[1]+L[2]+L[3])

### FIXED CODE ###

A,B,C = map(int, input().split())
L = sorted([A,B,C])
print(10*L[2]+L[1]+L[0])
import math

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

kaku = math.pi / 360 * abs(60 * h - 11 * M)

#yogen
ans = a ** 2 + b ** 2 - 2 * math.cos(kaku) * a * b

print(ans ** (1 /2))



### FIXED CODE ###

import math

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

kaku = math.pi / 360 * abs(60 * h - 11 * m)

#yogen
ans = a ** 2 + b ** 2 - 2 * math.cos(kaku) * a * b

print(ans ** (1 / 2))
N=int(input())
distances=list(map(int,input().split()))
maximum=max(distances)

if distances[0]!=0 or distances.count(0)>=2 or maximum>=N:
    print(0)
else:
    count_dist=list(distances.count(i) for i in range(maximum+1))
    if count_dist.count(0) >= 1:
        print(0)
    else:
        count=1
        for i in range(maximum):
            count = count*power_mod(count_dist[i],count_dist[i+1],998244353)%998244353
        print(count)

def power_mod(a, n, mod):
    a=a%mod
    if n==0:
        return 1
    elif n==1:
        return a
    elif n%2==0:
        return power_mod(a,n//2,mod)**2%mod
    else:
        return (power_mod(a,(n-1)//2,mod)**2%mod)*a%mod

### FIXED CODE ###

N=int(input())
print((N-1)//2)
X = int(input())
  print(int(X**0.5)**2)

### FIXED CODE ###

N = int(input())
print(int(N**0.5)**2)
List = list(map(int, input().split()))
res = 0
for i in range(3):
  for j in range(i,3):
    if List[i] == List[j]:
      res = 6 - i+1 -j+1
print(List[res])

### FIXED CODE ###

List = list(map(int, input().split()))
res = 0
for i in range(2):
  for j in range(i+1,3):
    if List[i] == List[j]:
      res = 3 - i - j
print(List[res])
from functools import reduce
def xor(i, k):
    return i^k
A, B = list(map(int, input().split()))
AB = list(range(A, B+1))
print(reduce(xor, AB))



### FIXED CODE ###

def f(a):
    if a%4 == 0:
        return a
    elif a%4 == 1:
        return 1
    elif a%4 == 2:
        return a^1
    elif a%4 == 3:
        return 0
A, B = list(map(int, input().split()))
print(f(A-1)^f(B))
x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    print(x)
else:
    num = set(range(1, 101)) ^ set(p)
    num = sorted([[abs(i - x), i] for i in num])
    if num[0][0] == num[1][0]:
        print(min(num[0][1], num[1][1]))
    else:
        print(num[0][1])


### FIXED CODE ###

x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    print(x)
else:
    num = list(set(range(-200, 200)) ^ set(p))
    num = sorted([[abs(i - x), i] for i in num])
    if len(num) >= 2 and num[0][0] == num[1][0]:
        print(min(num[0][1], num[1][1]))
    else:
        print(num[0][1])
from collections import deque

n = int(input())

g = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

c = list(map(int, input().split()))
c.sort()

ans = []
s = [0] * n
que = deque([0])
while que:
    t = que.popleft()
    ans.append(c.pop())
    s[t] = 1
    for e in g[t]:
        if not s[e]:
            que.append(e)

print(sum(c) - max(c))
print(*ans)


### FIXED CODE ###

import heapq

n = int(input())

g = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

c = list(map(lambda x: -int(x), input().split()))
heapq.heapify(c)
print(min(c) - sum(c))

ans = []
s = [-1] * n
leaf = -1
for i, a in enumerate(g):
    if len(a) == 1:
        leaf = i
        break

que = [leaf]
while que:
    t = que.pop()
    for e in g[t]:
        if s[e] == -1:
            s[e] = -heapq.heappop(c)
            que.append(e)

print(*s)
import itertools
import operator

dataset = []
while True:
    try:
        dataset.append(input())
    except EOFError:
        break

for item in dataset:
    try:
        a, b, c, d, e, f = [int(i) for i in item.split()]
    except:
        print("dataset cannot to be converted")
        break

    e = e * (a/d)
    f = f * (a/d)

    y = (c - f)/(b-e)
    x = (c - b*y) / a 

    print("{:.3f} {:.3f}".format(x, y))

### FIXED CODE ###

import sys
dataset = sys.stdin.readlines()

for item in dataset:
    a, b, c, d, e, f = list(map(int, item.split()))

    y = (c * d - f * a)/(b * d - e * a)
    x = (c * e - b * f) / (a * e - b * d)
    if x == 0:
        x = 0
    print("{:.3f} {:.3f}".format(x, y))
t = ("Sunny", "Cloudy", "Rain")
s = input()
print(t(t.index(s)+1)%3))

### FIXED CODE ###

l = ["Sunny", "Cloudy", "Rainy"]
s = input()
print(l[(l.index(s)+1)%3])
cost = [None,2,5,5,4,5,6,3,7,6]

Aset = {}
for a in A:
    c = cost[a]
    Aset[c] = max(Aset[c], a) if c in Aset else a
A = sorted([v for k,v in Aset.items()])

dp = [None]*(N+1)
dp[0] = (0,[0]*len(A))

for ia, a in enumerate(A):
    c = cost[a]
    for i in range(c, N+1):
        t = dp[i-c]
        if t and (dp[i]==None or t[0]+1>=dp[i][0]):
            dp[i] = (t[0]+1, t[1].copy())
            dp[i][1][ia] += 1
      	
l=[]
for i in range(len(A)):
    l += [A[len(A)-1-i]]*dp[N][1][len(A)-1-i]

print(*l, sep='')

### FIXED CODE ###

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
cost = [None,2,5,5,4,5,6,3,7,6]

Aset = {}
for a in A:
    c = cost[a]
    Aset[c] = max(Aset[c], a) if c in Aset else a
A = sorted([v for k,v in Aset.items()])

dp = [None]*(N+1)
dp[0] = (0,[0]*len(A))

for ia, a in enumerate(A):
    c = cost[a]
    for i in range(c, N+1):
        t = dp[i-c]
        if t and (dp[i]==None or t[0]+1>=dp[i][0]):
            dp[i] = (t[0]+1, t[1].copy())
            dp[i][1][ia] += 1
      	
l=[]
for i in range(len(A)):
    l += [A[len(A)-1-i]]*dp[N][1][len(A)-1-i]

print(*l, sep='')
import sys
import clipboard

# テストケースが複数行の場合、iOSだと一気に読み込んでしまう。
# 本番環境と同じ挙動になるように、
# iOSではテストケースをいったんテキストファイルにコピーして
# テキストファイルから input() する
if sys.platform == 'ios':
	sample = clipboard.get()
	file = open('input_file.txt', 'w')
	file.write(sample)
	file.close()
	sys.stdin = open('input_file.txt')
# -----------------------------
						

# D - RGB Triplets

N = int(input())
S = input()

r, g, b = 0, 0, 0

for s in S:
	if s == 'R':
		r += 1
	elif s == 'G':
		g += 1
	else:
		b += 1

ans = r * g * b

for i in range(N - 2):
	for j in range(i + 1, N - 1):
		for k in range(j + 1, N):
			if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
				if j -i == k -j:
					ans -= 1

print(ans) 

### FIXED CODE ###

# D - RGB Triplets
	
N = int(input())
S = input()
	
r, g, b = 0, 0, 0
	
for s in S:
	if s == 'R':
		r += 1
	elif s == 'G':
		g += 1
	else:
		b += 1
	
ans = r * g * b
	
for i in range(N - 2):
	for j in range(i + 1, N - 1):
		k = j * 2 - i
			
		if k < N:
			if S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
				if j -i == k -j:
					ans -= 1
	
print(ans)
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN=1000001;
bool p[MAXN];
vector<int> a;
int main(){
	memset(p,false,sizeof(p));
	for (int i=2;i<sqrt(MAXN);i++)
		for (int j=i+i;j<MAXN;j+=i)
			p[j]=true;
	for (int i=2;i<MAXN;i++)
		if (!p[i])
			a.push_back(i);
	int n;
	while (cin >> n){
		vector<int>::iterator f=lower_bound(a.begin(),a.end(),n);
		if (*f==n)
			cout << f-a.begin()+1 << endl;
		else
			cout << f-a.begin() << endl;
	}
	return 0;
}

### FIXED CODE ###

import math
def lb(a,x):
    l=0
    r=len(a)-1
    while l<r:
        mid=int((l+r)/2)
        #print "l=",l,' r=',r
        if a[mid]<x:
            l=mid+1
        else:
            r=mid
    return l

#maxn=1000001 // Wrong Answer?
maxn=1000010
a=[False for i in xrange(maxn)]
for i in xrange(2,int(math.sqrt(maxn))):
    for j in xrange(i+i,maxn,i):
        a[j]=True
b=[]
for i in xrange(2,maxn):
    if not a[i]:
        b.append(i)
while True:
    try:
        n=input()
        f=lb(b,n)
        if b[f]==n:
            print(f+1)
        else:
            print(f)
    except EOFError: break
,k = map(int,input().split())
R,S,P =map(int,input().split())
T = list(input())
value= {'r':P,'s':R,'p':S}
ans = 0
pre = ''
#k個ごとのグループで考える
for i in range(k):
    num = i
    while num<n:
        if pre == T[num]:#同じ手だったら負けかあいこ．つまり0点カウント
            pre = ''
        else:
            pre = T[num]
            ans += value[pre]
        num += k
print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
R,S,P =map(int,input().split())
T = list(input())
value= {'r':P,'s':R,'p':S}
ans = 0
#k個ごとのグループで考える
for i in range(k):
    num = i
    pre = ''
    while num<n:
        if pre == T[num]:#同じ手だったら負けかあいこ．つまり0点カウント
            pre = ''
        else:
            pre = T[num]
            ans += value[pre]
        num += k
print(ans)
n, u, v = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(n-1)]
u -= 1
v -= 1

e = [[] for _ in range(n)]
for a, b in ab:
    e[a].append(b)
    e[b].append(a)

if len(e[u]) == 1:
    if e[u][0] == v:
        print(0)
        exit()

t = [0] * n
a = [0] * n

def dfs(x, p, d, c):
    if len(e[x]) == 1:
        if e[x][0] == p:
            return
    for y in e[x]:
        if y == p:
            continue
        if c == 0:
            t[y] = d
        else:
            a[y] = d
        dfs(y, x, d+1, c)

dfs(u, -1, 1, 0)
dfs(v, -1, 1, 1)
ans = 0
for i in range(n):
    if t[i] < a[i]:
        ans = max(a[i], ans)

print(ans-1)

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(10 ** 5)

n, u, v = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(n-1)]
u -= 1
v -= 1

e = [[] for _ in range(n)]
for a, b in ab:
    e[a].append(b)
    e[b].append(a)

t = [0] * n
a = [0] * n

def dfs(x, p, d, c):
    if len(e[x]) == 1:
        if e[x][0] == p:
            return
    for y in e[x]:
        if y == p:
            continue
        if c == 0:
            t[y] = d
        else:
            a[y] = d
        dfs(y, x, d+1, c)

dfs(u, -1, 1, 0)
dfs(v, -1, 1, 1)
ans = 0
for i in range(n):
    if t[i] < a[i]:
        ans = max(a[i], ans)

print(ans-1)
import numpy as np
X =int(input())
 
if X == 2:
    print(X)
 
else:
    s = np.array([2])
    
    for i in range(2, 10**5 + 3):
        res = True
        for j in s:
            if (i % j) == 0:
                res = False
                break
        
        if res == True:
            s = np.append(s, i)
            if i >= X:
                print(i)
                break

### FIXED CODE ###

# -*- coding: utf-8 -*-
s, t = input().split()
res = t + s
print(res)
import collections

N = input().strip()
N = int(N)
dic = collections.defaultdict(lambda: 0)

for i in range(N):
    x,y = input().strip().split(" ")
    x = int(x)
    y = int(y)

    dic[y] += x

prev_time = 0
result = "Yes"

for k,v in dic.items():
    if v > k:
        result = "No"
        break
    prev_time += v

print(result)

### FIXED CODE ###

import fractions

A,B,C,D = input().strip().split(" ")
A = int(A)
B = int(B)
C = int(C)
D = int(D)
X = C*D // fractions.gcd(C,D)

c = B//C - A//C + int(A%C == 0)
d = B//D - A//D + int(A%D == 0)
cd = B//X - A//X + int(A%X == 0)

delim = c + d - cd
result = B - A + 1 - delim 
print(result)
#!/usr/bin/env python3
import sys
try:
    from math import gcd
except Exception:
    from fraction import gcd


def solve(S: str):
    return sum([int('{}1'.format(s)) for s in S])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    result = solve(S)
    print(result)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(S: str):
    return sum([int('{}1'.format(s)) for s in S])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    result = solve(S)
    print(result)

if __name__ == '__main__':
    main()
from math import *
while :
    n = int(raw_input())
    if n == 0:
        break
    for i in range(n):
        sco = map(int,raw_input().split())
        ave=0.0
        for i in sco:
            ave += i
        ave /= n

        dev = 0.0
        for i in sco:
            dev += (i-ave)*(i-ave)
        dev /= n

        print sqrt(dev)

### FIXED CODE ###

from math import *
while True:
    n = 0
    n = int(input())
    if n == 0:
        break
    else :
        sco = map(int,raw_input().split())
        for i in range(n):
            ave=0.0
            for i in sco:
                ave += i
            ave /= n
            dev = 0.0
            for i in sco:
                dev += (i-ave)*(i-ave)
            dev /= n
        print sqrt(dev)
input()
a = list(map(int,input().split()))
ans = 1
for n in a:
    ans *= n
    if ans <= 10**18:
        print(ans)
        break:
print(-1)

### FIXED CODE ###

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