Harryxun/stf_run huggingface dataset:
from math import gcd
import sys

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]

cnt = 1
min_a = min(a)
while min_a % 2 == 0:
    cnt *= 2
    min_a = min_a // 2

ans = 1
for i in a:
    if (i // cnt) % 2 == 0:
        print(0)
        sys.exit()
    ans = (ans * i) // gcd(ans, i)

print((m//ans+1)//2)


### FIXED CODE ###

from fractions import gcd
import sys

n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]

cnt = 1
min_a = min(a)
while min_a % 2 == 0:
    cnt *= 2
    min_a = min_a // 2

ans = 1
for i in a:
    if (i // cnt) % 2 == 0:
        print(0)
        sys.exit()
    ans = (ans * i) // gcd(ans, i)

print((m//ans+1)//2)
from copy import *
from sys import *
from math import *
import queue
from collections import defaultdict,Counter,deque

setrecursionlimit(1000000)

def main():
	n,m = map(int,input().split())
	ab = [list(map(int,input().split())) for _ in range(m)]
	b = {}
	for i in ab:
		try:
			b[i[0]].append(i[1])
		except:
			b[i[0]] = [i[1]]
		try:
			b[i[1]].append(i[0])
		except:
			b[i[1]] = [i[0]]
	ab = copy.deepcopy(b)
	for i in ab[1]:
		if(n in ab[i]):
			print('POSSIBLE')
			sys.exit()
	print('IMPOSSIBLE')

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(m,n):
	x = max(m,n)
	y = min(m,n)
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	return y

class Queue():
	#競プロ用のQueue
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)

class Stack():
	#怯プロ用のStack
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)

main()

### FIXED CODE ###

import copy
import sys
import math

def main():
	n,m = map(int,input().split())
	ab = [list(map(int,input().split())) for _ in range(m)]
	b = {}
	for i in ab:
		try:
			b[i[0]].append(i[1])
		except:
			b[i[0]] = [i[1]]
		try:
			b[i[1]].append(i[0])
		except:
			b[i[1]] = [i[0]]
	ab = copy.deepcopy(b)
	for i in ab[1]:
		if(n in ab[i]):
			print('POSSIBLE')
			sys.exit()
	print('IMPOSSIBLE')


def listtodict(a):
	b = {}
	for i in a:
		try:
			b[i] += 1
		except:
			b[i] = 1
	return b

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

main()
n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
sorted(e,key= lambda x : x[1])
s=[]
for i in e:
  if i[0]<=s[-1]:
    pass
  else:
    s.append(i[1]-1)
    
print(len(s))

### FIXED CODE ###

n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
new_e =sorted(e,key= lambda x : x[1])
s=[]
for i in new_e:
  if s!= [] and i[0]<=s[-1]:
    pass
  else:
    s.append(i[1]-1)

print(len(s))
# -*- coding: utf-8 -*-

from decimal import *
import numpy as np


getcontext().prec = 6

L = int(input())
L = Decimal(L)

x=y=z=0
x = Decimal(x)
y = Decimal(y)
z = Decimal(z)


p = 0.01
p = Decimal(p)

maxV = 0

for x in np.arange(p,L+1,p):
    for y in np.arange(p,L+1,p):
        z = L-(x+y)

        V = x*y*z
    
        if maxV < V:
            maxV = V


print(maxV)

### FIXED CODE ###

L = int(input())

x=y=z=0

x=y=z=L/3

V = x*y*z




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

for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int, input().split()))

for i in range(n):
    if all((x == i for x in a)):
        print(i)

### FIXED CODE ###

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

d = [0]*k
a = [0]*k

for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int, input().split()))

k = 0

b = sum(a, [])
    
for i in range(n):
    if i+1 not in b:
        k = k + 1

print(k)
A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
print(target)
for i in range(2,target):
    if target % i == 0:
        cnt += 1
    if cnt == K:
        break
print(int(target / i))

### FIXED CODE ###

A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
if K == 1:
    print(target)
else:
    for i in range(2,target):
        if target % i == 0:
            cnt += 1
        if cnt == K:
            break
    print(int(target / i))
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    N = II()
    info = []
    MAXL = 101
    b = [[0] * MAXL for _ in range(MAXL)]

    def vtop(x1,x2,y1,y2,h1):
        ans = h1 + abs(x1-x2) + abs(y1-y2)
        return ans if ans <= 10**9 else 0

    # get info
    initidx = -1000
    for i in range(N):
        x,y,h = LMIIS()
        info.append((x,y,h))
        if h > 0:
            initidx = i

    # init candidates
    x,y,h = info[initidx]
    for i in range(MAXL):
        for j in range(MAXL):
            b[i][j] = vtop(x,j,y,i,h)

    # check
    for x,y,h in info:
        for i in range(MAXL):
            for j in range(MAXL):
                if h == 0:
                    if b[i][j] > vtop(x,j,y,i,h):
                        b[i][j] = -1

                else:
                    if b[i][j] != vtop(x,j,y,i,h):
                        b[i][j] = -1

    # answer
    ansl = []
    for i in range(MAXL):
        for j in range(MAXL):
            if b[i][j] > 0:
                ansl.append((j,i,b[i][j]))
    if len(ansl) > 1:
        raise Exception()
    else:
        x,y,h = ansl[0]
        print(x,y,h)


if __name__ == '__main__':
    main()

### FIXED CODE ###

#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())

    N = II()
    info = []
    for _ in range(N):
        xi, yi, hi = LMIIS()
        if hi != 0:
            xt, yt, ht = xi, yi, hi
        info.append((xi, yi, hi))

    for Cy in range(101):
        for Cx in range(101):
            H = ht + abs(xt - Cx) + abs(yt - Cy)
            found = True
            for xi, yi, hi in info:
                tmp_h = max(H - abs(Cy-yi) - abs(Cx-xi), 0)
                if tmp_h != hi:
                    found = False
                    break
            if found:
                print('{} {} {}'.format(Cx,Cy,H))
                return



if __name__ == '__main__':
    main()
N,M,V,P = map(int,input().split())
import numpy as np
A = list(map(int,input().split()))
A = np.array(sorted(A,reverse=True))
ans = P
if N//2<=V:
  V = N-V
  A += M
  x = A[P-1]
  for i in range(P,N):
    a = A[i]
    if a==x:
      ans += 1
    else:
      y = i
      break
  
  for i in range(y,y+M):
    z = i
    a = A[i]
    if x-V<=a:
      ans+=1
    else:
      break

  for j in range(z+1,N):
    if a==A[j]:
      ans+=1
      
    else:
      break
  print(ans)
  
else:
  x = A[P-1]
  for i in range(P,N):
    a = A[i]
    if a==x:
      ans += 1
    else:
      y = i
      break
  for i in range(y,y+M):
    a = A[i]

### FIXED CODE ###

N,M,V,P = map(int,input().split())
import numpy as np
A = list(map(int,input().split()))
A = np.array(sorted(A,reverse=True))
ans = P
x = A[P-1]
y=P
z = sum(A[P-1:y])
for i in range(y,N):
  a = A[i]
  d = a+M
  if x<=d:
    b = N-i+P-1
    c = M*(V-b)
    e = z+c
    f = d*(i-P+1)
    if f>=e:
      ans+=1
      
  z+=a
print(ans)
import numpy as np
import math

N,A,B = map(int, input().split())
h = np.zeros(N)

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

ans = 0
mn = 0
mx = np.ceil(h.max()/B)
now = mx//2
while (mx-mn) > 1 :
    if now >= sum(np.ceil(tmp[tmp>0]/(A-B))) :
        mx = now
    else :
        mn = now

    now = (mx+mn)//2

print(int(mx))

### FIXED CODE ###

import numpy as np
import math

N,A,B = map(int, input().split())
h = np.zeros(N)

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

ans = 0
mn = 0
mx = np.ceil(h.max()/B)
now = mx//2
while mx != mn :
    if (mx-mn) == 1 :
        tmp_mx = h-B*mx
        tmp_mn = h-B*mn
        T_mx = sum(np.ceil(tmp_mx[tmp_mx>0]/(A-B)))
        T_mn = sum(np.ceil(tmp_mn[tmp_mn>0]/(A-B)))

        if T_mn == mn :
            ans = mn
        else :
            ans = mx

        break

    tmp = h-B*now
    T = sum(np.ceil(tmp[tmp>0]/(A-B)))
    if now >= T :
        ans = now
        mx = now
    else :
        mn = now

    now = (mx+mn)//2

print(int(ans))
import math


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


def main():
    A, B, C, D = map(int, input().split())
    first = B // C - A // C
    first += 1 if A % C == 0 else 0
    second = B // D - A // D
    second += 1 if A % D == 0 else 0
    tmp = lcm(C, D)
    both = B // tmp - A // tmp
    both += 1 if A % tmp == 0 else 0
    print(B - A + 1 - first - second + both)
    return


main()


### FIXED CODE ###

# バージョン 3.4.X 以前
import fractions
# バージョン 3.5 以降
# mport math


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


def main():
    A, B, C, D = map(int, input().split())
    first = B // C - A // C
    first += 1 if A % C == 0 else 0
    second = B // D - A // D
    second += 1 if A % D == 0 else 0
    tmp = lcm(C, D)
    both = B // tmp - A // tmp
    both += 1 if A % tmp == 0 else 0
    print(B - A + 1 - first - second + both)
    return


main()
S = input()
if all("a" in S,"b" in S ,"c" in S):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
cnt = 0
for i in ["a","b","c"]:
  if i in S:
    cnt+=1
print("Yes" if cnt==3 else"No")
import numpy as np
import math
import collections
import bisect
from difflib import SequenceMatcher


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

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

    cumsumA = np.cumsum(A)
    p = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[p - 1]
    tmp = p
    ans = tmp

    cntA = 0
    import numpy as np


import math
import collections
import bisect
from difflib import SequenceMatcher


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

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

    cumsumA = np.cumsum(A)
    a = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[a - 1]
    tmp = a
    ans = tmp

    b = 0
    while(b < len(B)):
        if time + B[b] <= K:
            time += B[b]
            tmp += 1
            b += 1
            if tmp > ans:
                ans = tmp
        else:
            if a < 0:
                break
            time -= A[a]
            a += -1
            tmp += -1

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np
import math
import collections
import bisect
from difflib import SequenceMatcher


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

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

    cumsumA = np.cumsum(A)
    p = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[p - 1]
    tmp = p
    ans = tmp

    cntA = 0
    import numpy as np


import math
import collections
import bisect
from difflib import SequenceMatcher


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

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

    cumsumA = np.cumsum(A)
    a = bisect.bisect_left(cumsumA, K + 0.1) - 1
    time = cumsumA[a]
    tmp = a + 1
    ans = tmp

    b = 0
    while(b < len(B)):
        #print(a, b, ans)
        if time + B[b] <= K:
            time += B[b]
            tmp += 1
            b += 1
            if tmp > ans:
                ans = tmp
        else:
            if a < 0:
                break
            time -= A[a]
            tmp += -1
            a += -1

    print(ans)


if __name__ == '__main__':
    main()
def m(list1,n): 
    mul=1
    for i in range(n): 
         mul=mul*list1[i] 
    return mul 
      
n=int(input())
arr=list(map(int,input().split()))
if m(arr)>pow(10,18):
    print(-1)
else:
    print(m(arr)) 
 


### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
ans=int(1)
temp=int(0)
for i in range(n):
  if(ans>(10**18)):
    ans=-1
  if(ans!=-1):
  	ans*=arr[i]
  if(arr[i]==0):
    temp=int(1)
if(ans>(10**18)):
  ans=-1
if(temp==1):
  ans=0
print(int(ans))
a,m=map(int,input().split())
print((a+b)%24)

### FIXED CODE ###

a,b=map(int,input().split())
print((a+b)%24)
a=str(input())
b=str(input())
for n in range(0,len(a)):
    if 3*n+1>b:
        break
print(n)


### FIXED CODE ###

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

for n in range(0,20):
    if n*(a-1)>=b-1:
        break

print(n)
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    
    pr = [0]*(max(a)+1)
    for num in a:
        pr[num] += 1
    for i in range(2, max(a)+1):
        count = sum(pr[i::i])
        if count == N:
            print("not coprime")
        elif count > 1:
            flag = False
    if flag:
        print("pairwise coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    pr = [0]*(max(a)+1)
    flag = True
    for num in a:
        pr[num] += 1
    for i in range(2, max(a)+1):
        count = sum(pr[i::i])
        if count == N:
            print("not coprime")
            exit()
        elif count > 1:
            flag = False
    if flag:
        print("pairwise coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()
N = int(input())
numbers = list(map(int,input().split()))
numOfOperation = int(input())
dic = {}

for num in numbers:
    if num in dic : dic[num] += 1
    else: dic[num] = 1
    

sums = sum(numbers)
for i in range(numOfOperation):
    B,C = map(int,input().split())
    cnt = dic[B]
    dic[B] = 0
    if (C not in dic) : dic[C] = 1
    else : dic[C] += cnt
    sums += cnt * (C - B)
    print(sums)


### FIXED CODE ###

N = int(input())
numbers = list(map(int,input().split()))
numOfOperation = int(input())
dic = {}

for num in numbers:
    if num in dic : dic[num] += 1
    else: dic[num] = 1
    

sums = sum(numbers)
for i in range(numOfOperation):
    B,C = map(int,input().split())
    if (B in dic) : 
        cnt = dic[B]
        dic[B] = 0
        if (C not in dic) : dic[C] = cnt
        else : dic[C] += cnt
        sums += cnt * (C - B)
    print(sums)
# -*- coding: UTF-8 -*-
a, b, c = map(int, raw_input().split())
if a<b<c:
	print "Yes"
else:
	print "No"

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if a<b<c:
	print "Yes"
else:
	print "No"
from collections import defaultdict
import heapq
N,K=map(int,input().split())

hq=[]
tset_all=set()
for i in range(N):
  t,d=map(int,input().split())
  heapq.heappush(hq,(-d,t))
  tset_all.add(t)
#print(heapq)

hq_K=[]
dsum=0
tdic=defaultdict(int)
for i in range(K):
  md,t=heapq.heappop(hq)
  heapq.heappush(hq_K,((-md,t)))
  dsum-=md
  tdic[t]+=1  

t0=len(tdic)
max_answer=dsum+(t0**2)
#print(t0,max_answer)

for i in range(t0+1,len(tset_all)+1):  
  loop_flg=True
  while(loop_flg):
    d,t=heapq.heappop(hq_K)
    if tdic[t]>1:
      tdic[t]-=1
      dsum-=d
      
      while(True):
        md2,t2=heapq.heappop(hq)
        if tdic[t2]==0:
          dsum-=md2
          loop_flg=False
          break
          
  answer_i=dsum+(i**2)
  #print(i,answer_i)
  max_answer=max(max_answer,answer_i)
  
print(max_answer)

### FIXED CODE ###

from collections import defaultdict
import heapq
N,K=map(int,input().split())

hq=[]
tset_all=set()
for i in range(N):
  t,d=map(int,input().split())
  heapq.heappush(hq,(-d,t))
  tset_all.add(t)
#print(heapq)

hq_K=[]
dsum=0
tdic=defaultdict(int)
for i in range(K):
  md,t=heapq.heappop(hq)
  heapq.heappush(hq_K,((-md,t)))
  dsum-=md
  tdic[t]+=1  

t0=len(tdic)
max_answer=dsum+(t0**2)
#print(t0,max_answer)

for i in range(t0+1,min(K,len(tset_all))+1):
  loop_flg=True
  while(loop_flg):
    d,t=heapq.heappop(hq_K)
    if tdic[t]>1:
      tdic[t]-=1
      dsum-=d
      
      while(True):
        md2,t2=heapq.heappop(hq)
        if tdic[t2]==0:
          tdic[t2]=1
          dsum-=md2
          loop_flg=False
          break
          
  answer_i=dsum+(i**2)
  #print(i,answer_i)
  max_answer=max(max_answer,answer_i)
  
print(max_answer)
n = int(input())
ans = 0

def gcd(x, y):
    if x / y == 0: return y
    return gcd(y, x % y)

for i in range(1, n + 1):
    for j in range(1, n + 1):
        for k in range(1, n + 1):
            ans += gcd(gcd(i, j), k)
print(ans)

### FIXED CODE ###

import math
k = int(input())
ansA, ansB, ansC = 0, 0, 0
for a in range(k):
    ansC += a+1
    for b in range(k-a-1):
        GCDab = math.gcd(a+1, a+b+2)
        ansB += GCDab
        for c in range(k-a-b-2):
            GCDabc = math.gcd(GCDab, a+b+c+3)
            ansA += GCDabc
ans = ansA * 6 + ansB * 6 + ansC
print(ans)
def p_d():
    from sys import stdin

    input = stdin.readline
    n = int(input())
    route = [[] for _ in range(n)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        w = 0 if w & 1 == 0 else 1
        route[u - 1].append((v - 1, w))
        route[v - 1].append((u - 1, w))

    ans = [-1] * n

    def dfs(p, d):
        ans[p] = d
        for i, j in route[p]:
            if ans[i] < 0:
                dfs(i, d ^ j)

    dfs(0, 0)
    print("\n".join(map(str, ans)))
    
p_d()

### FIXED CODE ###

def p_d():
    from sys import stdin
    input = stdin.readline
    import sys
    sys.setrecursionlimit(10 ** 6)
    n = int(input())
    route = [[] for _ in range(n)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        w = 0 if w & 1 == 0 else 1
        route[u - 1].append((v - 1, w))
        route[v - 1].append((u - 1, w))

    ans = [-1] * n

    def dfs(p, d):
        ans[p] = d
        for i, j in route[p]:
            if ans[i] < 0:
                dfs(i, d ^ j)

    dfs(0, 0)
    print("\n".join(map(str, ans)))
    
p_d()
N = int(input())
M = 10**9 + 7

dp = [0] * (N + 1)

dp[3] = 1
dp[4] = 1
dp[5] = 1
for i in range(6, N + 1):
    dp[i] = sum(dp[3:i - 3 + 1]) + 1
    dp[i] %= M

print(dp[-1] % M)

### FIXED CODE ###

N = int(input())
M = 10**9 + 7

if N < 3:
    print(0)
elif N < 6:
    print(1)
else:
    dp = [0] * (N + 1)

    dp[3] = 1
    dp[4] = 1
    dp[5] = 1
    for i in range(6, N + 1):
        dp[i] = sum(dp[3:i - 3 + 1]) + 1
        dp[i] %= M

    print(dp[-1] % M)
import math
n,k=map(int,input().split())
if n % k == 0:
	x= n//k
    print(x*math.factorial(k))
"""else:
	r= n % k
	div=n-r
	y=div//k
	sum= y*(math.factorial(k))
	z=nCr(k,r)
	sum+=z
	print(sum)
    """


def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

### FIXED CODE ###

n,k=map(int,input().split())
print(k*(k-1)**(n-1))
# 2019/07/20

from heapq import heappop,heappush,heapify

n,m=map(int,input().split())
a=list(map(int,input().split()))
heapify(a)
bc=[]
for i in range(m):
    b,c=map(int,input().split())
    hq=(-c,b)
    heappush(bc,hq)



def cg(res):

    while bc:
        c,b=heappop(bc)
        c=-c
        while b:
            b-=1
            v=heappop(a)
            if c>v:res+=c
            else:
                res+=v
                return res
    return res
res=0
res=cg(res)
print(sum(a)+res)

### FIXED CODE ###

# 2019/07/20

from heapq import heappop,heappush,heapify

n,m=map(int,input().split())
a=list(map(int,input().split()))
heapify(a)
bc=[]
for i in range(m):
    b,c=map(int,input().split())
    hq=(-c,b)
    heappush(bc,hq)



def cg(res):

    while bc:
        c,b=heappop(bc)
        c=-c
        while b and a:
            b-=1
            v=heappop(a)
            if c>v:res+=c
            else:
                res+=v
                return res
    return res
res=0
res=cg(res)
print(sum(a)+res)
n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

for x in range(101):
    for y in range(101):
        h = [0,10**10]
        h_memo = 0
        for i in range(n):
            if xy[i][2] == 0:
                h[1] = min(h[1],abs(xy[i][0]-x) + abs(xy[i][1]-y))
            else:
                h_memo = xy[i][2] + abs(xy[i][0]-x) + abs(xy[i][1]-y)
            #print(x,y,h[1],h_memo)
            if h[0]!=0:
                if h_memo == h[0]:
                    continue
                elif h_memo != h[0]:
                    break
                elif h[1] < h[0]:
                    break
            elif h[0]==0 and h_memo!=0:
                h[0] = h_memo
            elif h[0]==0 and h_memo==0:
                if h[1] < (abs(xy[0]-x) + abs(xy[1]-y)):
                    break
        else:               
            #print(x+1,y+1,h[0])
            if h[0]==0:
                continue
            else:
                print(x,y,h[0])

### FIXED CODE ###

n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

for x in range(101):
    for y in range(101):
        h_memo = 0
        for i in range(n):
            if xy[i][2] != 0:
                h_memo = xy[i][2] + abs(xy[i][0]-x) + abs(xy[i][1]-y)
                break
        for i in range(n):
            if xy[i][2] != max(0,h_memo-abs(xy[i][0]-x)-abs(xy[i][1]-y)):
                break

        else:               
            #print(x+1,y+1,h[0])

            print(x,y,h_memo)
            break
i = 0
while True:
    i += 1
    num = raw_input()
    if x == '0':
        break
    print "Case %d: %s" % (i,x)

### FIXED CODE ###

i = 0
while True:
    i += 1
    num = raw_input()
    if num == "0":
        break
    print "Case %d: %s" % (i,num)
n,m =map(int, input().split())
if n==m==1:
    print(0)
elif n==1 or n==0:
    print(cmb(m,2))
elif m==1 or m==0:
    print(cmb(n,2))
else:
    print(cmb(n,2)+cmb(m,2))

### FIXED CODE ###

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
  
n,m =map(int, input().split())
if n==m==1:
    print(0)
elif n==1 or n==0:
    print(cmb(m,2))
elif m==1 or m==0:
    print(cmb(n,2))
else:
    print(cmb(n,2)+cmb(m,2))
import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(1,n):
  edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
def dfs(now):
  res = 0
  for e in edg[now]:
    res = max(res, dfs(e))
  if res == k - 1 and a[e] != 0 and e != 0:
    ans[e] = 1
    res = 1
  return res + 1
      
dfs(0)
print(sum(ans))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n,k = map(int,input().split())
a = [int(i)-1 for i in input().split()]
edg = [[] for i in range(n)]
for i in range(1,n):
  edg[a[i]].append(i)
ans = [0] * n
ans[0] = a[0] != 0
def dfs(now):
  res = 0
  for e in edg[now]:
    res = max(res, dfs(e)+1)
  if res == k - 1 and a[now] != 0:
    ans[now] = 1
    res = -1
  return res
      
dfs(0)
print(sum(ans))
s = input()
if s.index('C') >= 0 and s.index('F') >= 0 and s.index('C') < s.index('F'):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

s = input()
if s.find('C') >= 0 and s.find('F') >= 0:
    if s.index('C') < s.rindex('F'):
        print('Yes')
    else:
        print('No')
else:
    print('No')
import math
r = int(input())
area = "{:.6f}".format(math.pi*(r*r))
circumference = "{:.6f}".format(2*r*math.pi)
print(area, circumference)


### FIXED CODE ###

import math
r = float(input())
print((r**2)*math.pi,r*2*math.pi)