Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
a=list(map(int,input().split()))
if k==0:
  print(sum(a))
  exit()
count=[0]*41
for i in range(n):
  x=int(bin(a[i])[2:])
  for j in range(len(bin(a[i])[2:])):
    count[i]+=(x%10)
    x=x//10
ans=0
y=len(bin(max(a))[2:])
for i in range(len(bin(k)[2:])):
  if count[i]*2>=n:
    ans+=count[i]*(2**i)
  else:
    ans+=(n-count[i])*(2**i)
for i in range(len(bin(k)[2:]),y):
  ans+=count[i]*(2**i)
print(ans)

### FIXED CODE ###

#入力
n,k=map(int,input().split())
a=list(map(int,input().split()))
bits=list(bin(k+1)[2:])
bits=list(map(int,bits))
stack=[0]*40
ans=0
#各bitごとの1の総数を保存
for i in a:
  num=bin(i)[2:]
  for j in range(len(num)):
    if num[j]=="1":
      stack[len(num)-j-1]+=1
#xがk+1より小さいならば、どこかのbitでxが0、k+1が1となるところがあるはず
#さらにそれより下位のbitでは1と0どちらにしても大小関係が変化しないので貪欲に求まる
for i in range(len(bits)):
  possible_ans=[q for q in bits]
  ans_stack=0
  #上からi番目のbitが変換点であると仮定
  #もしそのbitが0なら変換点にはなり得ない
  if possible_ans[i]==0:
    continue
  possible_ans[i]=0
  #stackは一番最初が一番小さいbitとなる
  #possible_ansのi桁目はstackのlen(bits)-i+1桁目に相当
  for j in range(40):
    if j<len(bits)-i-1:
      ans_stack+=max(stack[j]*2**j,(n-stack[j])*2**j)
    elif j<len(bits) and possible_ans[len(bits)-j-1]==1:
      ans_stack+=(n-stack[j])*2**j
    else:
      ans_stack+=stack[j]*2**j
  ans=max(ans,ans_stack)
#出力
print(ans)
b = 1
x = int(input())

answerNotFound = True
while (x + b**5)**(1/5) != int((x + b**5)**(1/5)) and b < 60:
    b += 1

if (x + b**5)**(1/5) != int((x + b**5)**(1/5)):
    b = -1
else:
    answerNotFound = False

if answerNotFound:
    while (x + b**5)**(1/5) != int((x + b**5)**(1/5)) and b > -60:
        b -= 1
        answerNotFound = True

if answerNotFound:
    print(int((x + b**5)**(1/5)), b)

### FIXED CODE ###

x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            quit()
A, B, K = map(int, input().split())
lst = range(A, B+1)
ans = lst[:K] + lst[-K-1:]
for i in ans:
  print(i)

### FIXED CODE ###

A, B, K = map(int, input().split())
lst1 = list(range(A, min(A+K, B+1)))
lst2 = list(range(max(B-K+1, A), B+1))
ans = set(lst1 + lst2)
ans = list(sorted(ans))
for i in ans:
  print(i)
from bisect import bisect_left

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

#print(M)
A.sort()
#print(A)

limit = sum(A)/(4*M)
#print(limit)

n = bisect_left(A, limit)
#print(N-n-1)
if N-n-1 >= M:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

#imput
a,b,c = map(int,input().split())

a, b = b, a
a, c = c, a

print(a,b,c)
N  = int(input())

print((1+N)(N)//2)

### FIXED CODE ###

N  = int(input())
ans = 0
for i in range(N+1):
  ans += i
print(ans)
#!/usr/bin python3
# -*- coding: utf-8 -*-

# 二分グラフ

N = int(input())
graph = [[] for _ in range(N)]
color = [-1]*N

# 隣接リストの作成
for i in range(N-1):
    a, b, w = map(int, input().split())
    a -= 1
    b -= 1
    w %= 2
    graph[a].append((b,w))
    graph[b].append((a,w))

# 深さ優先探索
def dfs(g,v,c):
    if color[v] == -1:
        color[v] = c
        for nv, w in g[v]:
            if color[nv]==1:
                continue
            nc = c
            if w != 0:
                nc = 1-c
            dfs(g,nv,nc)

def main():
    dfs(graph, 0, 1)
    for i in color:
        print(i)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

# 二分グラフ
N = int(input())
graph = [[] for _ in range(N)]
color = [-1]*N

# 隣接リストの作成
for i in range(N-1):
    a, b, w = map(int, input().split())
    a -= 1
    b -= 1
    w %= 2
    graph[a].append((b,w))
    graph[b].append((a,w))

next_q = [(0, 0)]
while len(next_q)>0:
    nw, nc = next_q.pop()
    color[nw] = nc
    for nxt, nl in graph[nw]:
        if color[nxt]==-1:
            next_q.append((nxt,(nl+nc)%2))
for i in color:
    print(i)
NMAB =  list(int(i) for i in input().split())
xy =  [[int(i) for i in input().split()] for i in range(NMAB[1])]

x = xy[0]
x.append(NMXY[2])
y = xy[1]
y.append(NMXY[3])
print(max(x))
print(min(y))
if max(x) < min(y):
    print('No War')
else:
    print('War')


### FIXED CODE ###


NMXY =  list(int(i) for i in input().split())
x =  list(int(i) for i in input().split())
y =  list(int(i) for i in input().split())

x.append(NMXY[2])

y.append(NMXY[3])

if max(x) < min(y):
    print('No War')
else:
    print('War')
N-int(input())
A=list(map(int,input().split()))
a=0
for i in range(N-1):
    a+=1/A[i]
print(1/a)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
a=0
for i in range(N):
    a+=1/A[i]
print(1/a)
import math
a_h, b_m, hour, minute = map(int, input().split(" "))
pi = math.pi
arg_h = (hour + minute/60) * 360/12
arg_m = minute * 360/60

diff_arg_abs = abs(arg_h - arg_m)
if diff_arg_abs > 180:
    diff_arg = diff_arg_abs - 180
elif diff_arg_abs < 180:
    diff_arg = diff_arg_abs
else:
    print(0)
    exit
    
ans_square = a_h**2 + b_m**2 - 2 * a_h * b_m * math.cos(math.radians(diff_arg)) 
ans = math.sqrt(ans_square)
print(ans)

### FIXED CODE ###

import math
a_h, b_m, hour, minute = map(int, input().split(" "))
pi = math.pi
arg_h = (hour + minute/60) * 360/12
arg_m = minute * 360/60

diff_arg = abs(arg_h - arg_m)
ans_square = a_h**2 + b_m**2 - 2 * a_h * b_m * math.cos(math.radians(diff_arg)) 
ans = math.sqrt(ans_square)
print(ans)
n, m = map(int, input().split())
ps = [list(input().split()) for _ in range(m)]

seito = 0
pena  = 0

for i in range(n):
    flg = False
    for j in range(m):
        if sp[j][0] == i and ps[j][1] == "AC":
            if flg == False:
                seito += 1
                flg = True
            elif ps[j][0] == i and ps[j][1] == "WA":
                if flg == False:
                    pena += 1
            else:
                pass

print(seito, pena)

### FIXED CODE ###

from collections import defaultdict

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

d = defaultdict(int)
ans = 0
pena = 0

for _ in range(m):
    p, s = input().split()
    if s == "AC":
        if d[p] == -1:
            continue
        else:
            ans += 1
            pena += d[p]
            d[p] = -1
    else:
        if d[p] == -1:
            continue
        else:
            d[p] += 1

print(ans, pena)
a,b = list(map(int,input().split()))
print(6-a-b)

### FIXED CODE ###

print(6-int(input())-int(input()))
a,t,x=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)

### FIXED CODE ###

a,t,i=input().split()
a=int(a)
t=int(t)
x=a*t
i=int(i)
c=min(x,i)
print(c)
1 1
1000

### FIXED CODE ###

n, k = map(int, input().split())
p = sorted(list(map(int, input().split())))
ans = 0
for i in range(k):
    ans += p[i]
print(ans)
import numpy as np

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

tmp = [[0 for i in range(N)] for i in range(N)]
for i in range(N):
    tmp[i][i] = 1
    tmp[i][(i+1)%N] = 1

A = np.matrix(tmp)
Y = np.matrix(W).T

ans = np.linalg.solve(A, Y)*2

tmp = []
for a in ans:
    tmp.append(str(int(a)))

print(" ".join(tmp))

### FIXED CODE ###

import numpy as np

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

ans = []

ans.append(str(sum(W) - 2 * sum([W[i] for i in range(N) if i % 2 == 1])))

for i in range(1, N):
    ans.append(str( 2*W[i-1] - int(ans[i-1])))

print(" ".join(ans))
import sys
from math import factorial

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    string_type = {}
    for s in inputs:
        count = {}
        s_list = list(s)
        s_list.sort()
        for c in s_list:
            if c in count:
                count[c] += 1
            else:
                count[c] = 1
        key = ""
        for k in count.keys():
            key += "{}{}".format(k, count[k])
        if key in string_type:
            string_type[key] += 1
        else:
            string_type[key] = 1

    comb_count = 0
    for v in string_type.values():
        if v != 1:
            if v == 2:
                comb_count += 1
            else:
                comb_count += factorial(v) / factorial(2) / factorial(v-2)
    return int(comb_count)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)


### FIXED CODE ###

import sys
from math import factorial

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    string_type = {}
    for s in inputs:
        count = {}
        s_list = list(s)
        s_list.sort()
        for c in s_list:
            if c in count:
                count[c] += 1
            else:
                count[c] = 1
        key = ""
        for k in count.keys():
            key += "{}{}".format(k, count[k])
        if key in string_type:
            string_type[key] += 1
        else:
            string_type[key] = 1

    comb_count = 0
    for v in string_type.values():
        if v != 1:
            if v == 2:
                comb_count += 1
            else:
                comb_count += factorial(v) // factorial(v-2) // factorial(2)
    return comb_count


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(inputs(N))
    print(ret)
N = int(input())
A = list(map(int, input().split()))  

cnt = 0
for i in N:
  if all([A[v] >= A[i] for v in i]): 
    cnt = cnt +1

print(cnt)

### FIXED CODE ###

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

min = 0
cnt = 0
for i in range(N):
  if i == 0:
    cnt += 1
    min = A[i]
    continue
  if A[i] <= min:
    cnt += 1
    min = A[i]

print(cnt)
a = list(map(int,input().split()))
s = sum(a)
ans = 1000
for i in range(3):
    for j in range(3):
        if i == j:
            continue
        b = abs(A[i]-A[j])+abs(A[j]-(a-(A[i]+A[j])))
        ans = min(ans,b)
print(ans)

### FIXED CODE ###

A = list(map(int,input().split()))
s = sum(A)
ans = 1000
for i in range(3):
    for j in range(3):
        if i == j:
            continue
        b = abs(A[i]-A[j])+abs(A[j]-(s-(A[i]+A[j])))
        ans = min(ans,b)
print(ans)
import itertools
import numpy as np
mylist = [0, 1]
n = int(input().rstrip())

mise = [list(map(int, input().rstrip().split())) for i in range(n)]
mine = [list(map(int, input().rstrip().split())) for i in range(n)]

maxnum = - float('inf')
for i in itertools.product(mylist, repeat = 10):
    if sum(i) == 0:
        continue
    sell = 0
    for j, k in zip(mise, mine):
        temp = 0
        for l in range(10):
            if j[l] == i[l] and j[l] == 1:
                temp += 1
        sell += k[temp]
    maxnum = max(maxnum, sell)
print(maxnum)

### FIXED CODE ###

import itertools
mylist = [0, 1]
n = int(input().rstrip())

mise = [list(map(int, input().rstrip().split())) for i in range(n)]
mine = [list(map(int, input().rstrip().split())) for i in range(n)]

maxnum = - float('inf')
for i in itertools.product(mylist, repeat = 10):
    if sum(i) == 0:
        continue
    sell = 0
    for j, k in zip(mise, mine):
        temp = 0
        for l in range(10):
            if j[l] == i[l] and j[l] == 1:
                temp += 1
        sell += k[temp]
    maxnum = max(maxnum, sell)
print(maxnum)
N = int(input())
h = [i for i in map(int, input().split())]    
def jump(point):
    if point <= 0:
        return 0
    if memo[point] != inf:
        return memo[point]
    if point ==1:
        memo[1] = abs(h[0]-h[1])
        return abs(h[0]-h[1])
    memo[point] = min(jump(point-1)+abs(h[point-1]-h[point]), jump(point-2)+abs(h[point-2]-h[point]))
    return min(jump(point-1)+abs(h[point-1]-h[point]), jump(point-2)+abs(h[point-2]-h[point]))
    
inf = 10**10
memo = [inf]*(N+1)
print(jump(N-1))

### FIXED CODE ###

N = int(input())
h = [i for i in map(int, input().split())]    
memo = [0] * (N+1)
for i in range(N):
    if i == 0:
        pass
    elif i == 1:
        memo[1] = abs(h[1]-h[0])
    else:
        memo[i] = min(memo[i-1]+abs(h[i]-h[i-1]),  memo[i-2]+abs(h[i]-h[i-2]))
print(memo[N-1])
S=input()
T=input()
T.pop()
if(T==S):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
T=input()
if(T[:-1]==S):
  print("Yes")
else:
  print("No")
a,b=map(int,input().split())
c=a*b
print(c)

### FIXED CODE ###

from math import floor
from fractions import Fraction
a,b=map(str,input().split())
a=int(a)
b=Fraction(b)
print(int(a*b))
import numpy as np
x = input()
y = input()
z = input()
xa = x.split(" ")
ya = y.split(" ")
za = z.split(" ")
A = np.array([xa,ya,za])
N = int(input())
b =[]
C = np.array([["Nomark", "Nomark", "Nomark"],["Nomark", "Nomark", "Nomark"],["Nomark", "Nomark", "Nomark"]])
for i in range(1,N+1):
    b.append(input())
for m in range(0,3):
    for n in range(0,3):
        if A[m, n] in b:
            C[m,n] = "Maru"
tate = str(np.count_nonzero(C == 'Maru', axis=0))

yoko = str(np.count_nonzero(C == 'Maru', axis=1))

if "3" in tate or "3" in yoko:
    print('Yes')
elif C[0,0] == "Maru" and C[1,1] == "Maru" and C[2,2] == "Maru":
    print("Yes")
elif C[0,2] == "Maru" and C[1,1] == "Maru" and C[2,0] == "Maru":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = int(input())
if a%2 == 0:
    b = a/2
else:
    b=(a+1)/2
print(int(b))
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

BC.sort(key=lambda x: x[1], reverse=True)
s = 0
for B, C in BC:
    A.sort()
    mn = A[0]
    if mn >= C:
        s += sum(A)
        break
    if A[B - 1] <= C:
        s += B * C
        A = A[B:]
    else:
        a, b = 0, B
        while a + 1 < b:
            i = a + (b - a) // 2
            if A[i] >= C:
                b = i
            else:
                a = i
        A[:b] = [C] * b
        s += sum(A)
        break

print(s)

### FIXED CODE ###

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

BC.sort(key=lambda x: x[1], reverse=True)
A.sort()
l, r = 0, N
for B, C in BC:
    if A[l] >= C:
        break
    a, b = l, r
    if A[r - 1] >= C:
        while a + 1 < b:
            i = a + (b - a) // 2
            if A[i] >= C:
                b = i
            else:
                a = i
        r = b
    n = B + l
    if n > r:
        n = r
        B = n - l
    if n <= b:
        A[l:n] = [C] * B
        l = n
    else:
        A[l:b] = [C] * B
        l = b
    if l == r:
        break

print(sum(A))
n, m = map(int, input())
print((n-2) * (m-2))

### FIXED CODE ###

n, m = map(int, input().split())
if n >= 2:
  if m >= 2:
    print((n-2) * (m-2)) 
  else:
    print((n-2) * m)
else:
  if m >= 2:
    print(n * (m-2)) 
  else:
    print(n * m)
a,b,c,d = map(int,input().split())
import math
lcm = c * d // math.gcd(c, d)

def num_of_complements(x,c,d):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d) - num_of_complements(a-1,c,d)
print(ans)


### FIXED CODE ###

a,b,c,d = map(int,input().split())
from fractions import gcd
lcm = c * d // gcd(c, d)
def num_of_complements(x,c,d,lcm):
    num = x + x//lcm - x//c - x//d
    return num

ans = num_of_complements(b,c,d,lcm) - num_of_complements(a-1,c,d,lcm)
print(ans)
N = int(input())

ans = -1

for i in range(1,N+1):
    if int(i*1.08) == N:
        ans = i

if ans =! -1:
    print(ans)
else:
    print(":(")


### FIXED CODE ###

N = int(input())

ans = -1

for i in range(1,N+1):
    if int(i*1.08) == N:
        ans = i

if ans != -1:
    print(ans)
else:
    print(":(")
a,b,c = map(int,input(),split())
print(min([a+b,b+c,c+a]))

### FIXED CODE ###

a,b,c = map(int,input().split())
print(min([a+b,b+c,c+a]))
MOD=10**9+7
n,m=map(int,input().split())
A=[1 for i in range(n)]
if n!=1:
  A[1]=2
  for i in range(m):
    A[int(input())-1]=0
  
  if A[0]==0 and A[1]!=0:
    A[1]=1


  for i in range(2,n):
    if A[i]!=0:
      A[i]=(A[i-1]+A[i-2])
      A[i]%=MOD

    
  print(A[n-1])
  
else:print(1)


### FIXED CODE ###

p,q,r=map(int,input().split())

ans=[p+q,q+r,r+p]
print(min(ans))
import math
H,N = list(map(int,input().split()))
A, B = [], []
for _ in range(N):
  a,b = list(map(int,input().split()))
  A.append(a)
  B.append(b)
dp = [math.inf] * (H+1)

for h in range(1, H+1):
  for i in range(N):
      if h - A[i] <= 0:
          dp[h] = min(dp[h], B[i])
      else:
          dp[h] = min(dp[h], B[i] + dp[h - A[i]])

print(dp[-1])

### FIXED CODE ###

H,N = list(map(int,input().split()))
dp = [float("inf")] * (H+1)

for i in range(N):
  a,b = list(map(int,input().split()))

  for h in range(1, H+1):
    if h - a <= 0:
      dp[h] = min(dp[h], b)
    else:
      dp[h] = min(dp[h], b + dp[h - a])

print(dp[-1])
# import
import numpy as np

# input
H, W = map(int, input().split())

Mtmp = []
for _ in range(H):
    tmp = list(input())
    Mtmp.append(tmp)

M = np.array(Mtmp)
S = np.array([[0]*W]*H)

#print(M)

digtmp = np.array([[0, 1], [1, 0], [0, -1], [-1, 0]])

def dfs(i, j):
    global ngflag
    global searchflag
    if S[i, j] == 1:
        return
    S[i, j] = 1
    if M[i, j] == '.':
        return
    #print("i:{}, j:{}".format(i, j))
    searchflag = 1
    dig = digtmp + np.array([i, j])
    for d in dig:
        if 0 <= d[0] < H and 0 <= d[1] < W:
            if M[d[0], d[1]] == '#':
                ngflag = 0
                dfs(d[0], d[1])

searchflag = 0

while True:
    ngflag = 1
    if 0 not in S:
        if M[target[0], target[1]] == '.':
            ngflag = 0
        break
    target = list(zip(*np.where(S == 0)))[0]
    #print("sf:{}, ng:{}".format(searchflag, ngflag))
    dfs(target[0], target[1])
    if M[target[0], target[1]] == '#' and searchflag == 1 and ngflag == 1:
        break
        

#print("sf:{}, ng:{}".format(searchflag, ngflag))

if searchflag == 1 and ngflag == 0:
    ans = 'Yes'
elif searchflag == 1 and ngflag == 1:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)


### FIXED CODE ###


# import
import numpy as np
import sys
sys.setrecursionlimit(10**6)

# input
H, W = map(int, input().split())

Mtmp = []
for _ in range(H):
    tmp = list(input())
    Mtmp.append(tmp)

M = np.array(Mtmp)
S = np.array([[0]*W]*H)

#print(M)

digtmp = np.array([[0, 1], [1, 0], [0, -1], [-1, 0]])

def dfs(i, j):
    global ngflag
    global searchflag
    if S[i, j] == 1:
        return
    S[i, j] = 1
    if M[i, j] == '.':
        return
    #print("i:{}, j:{}".format(i, j))
    searchflag = 1
    dig = digtmp + np.array([i, j])
    for d in dig:
        if 0 <= d[0] < H and 0 <= d[1] < W:
            if M[d[0], d[1]] == '#':
                ngflag = 0
                dfs(d[0], d[1])

searchflag = 0
ngflag = 1

while True:
    if 0 not in S:
        if M[target[0], target[1]] == '.':
            ngflag = 0
        break
    target = list(zip(*np.where(S == 0)))[0]
    #print("sf:{}, ng:{}".format(searchflag, ngflag))
    if M[target[0], target[1]] == '#':
        ngflag = 1
    dfs(target[0], target[1])
    if M[target[0], target[1]] == '#' and searchflag == 1 and ngflag == 1:
        break


#print("sf:{}, ng:{}".format(searchflag, ngflag))

if searchflag == 1 and ngflag == 0:
    ans = 'Yes'
elif searchflag == 1 and ngflag == 1:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)
sosu = []
N = int(input())
g = 10 ** 9 + 7
def add(a, b):
  return (a + b) % g

d = []
DP = [0] * (max(2,N)+1)
DP[1] = 0
DP[2] = 1
for i in range(2, N+1):
  for j in (x for x in d if j * j <= N):
    if i % j == 0:
      DP[i] = DP[j] + DP[i//j]
      break
  else:
    d.append(i)
    DP[i] = 1

print(DP[N]+1)


### FIXED CODE ###

from functools import reduce
N = int(input())
g = 10 ** 9 + 7

def add(a, b):
  return (a + b) % g
def mul(a, b):
  return (a * b) % g

def adda(a, p1, p2):
    for x in range(len(a)):
        a[x] = add(p1[x], p2[x])

d = []
DP = [[0 for _ in range(N+1)] for _ in range(N+1)]
ans = [0 for _ in range(N+1)]
for i in range(2, N+1):
  for j in (x for x in d if x * x <= N):
    if i % j == 0:
      adda(DP[i], DP[j], DP[i//j])
      break
  else:
    d.append(i)
    DP[i][i] = 1
  adda(ans, ans, DP[i])

print(reduce(mul, [x + 1 for x in ans[1:N+1]]))
1 a = int(input())
2 s = input()
3 print(s if a >= 3200 else 'red')

### FIXED CODE ###

a = int(input())
s = input()
print(s if a >= 3200 else 'red')
import math
N=int(input())
A=[int(i) for i in input().split()]
ans=A[i]
for i in range(N-1):
    ans=math.gcd(ans,A[i+1])
print(ans)

### FIXED CODE ###

from fractions import gcd
N=int(input())
A=[int(i) for i in input().split()]
ans=A[0]
for i in range(N-1):
    ans=gcd(ans,A[i+1])
print(ans)
n = int(input())

if n // 2 == 0:

    print(1 / 2)

else:

    print((n + 1) / 2n)

### FIXED CODE ###

n = int(input())

if n % 2 == 0:

    print(1 / 2)

else:

    print((n + 1) / 2 / n)
import math

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

def is_ok(mid):
    cnt = 0
    for i in range(N):  cnt += (math.floor(A[i] / mid) - 1)
    return cnt <= K

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

if K == 0:  print(max(A))
else:
    left = max(A) + 1
    right = -1
    ret = binary_search(right, left)
    print(ret)

### FIXED CODE ###

import math

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

def is_ok(mid):
    cnt = 0
    for i in range(N):  cnt += (math.ceil(A[i] / mid) - 1)
    return cnt <= K

def binary_search(left, right):
    while (abs(right - left) > 1):
        mid = (left + right) // 2
        if is_ok(mid):  right = mid
        else:  left = mid
    return right

if K == 0:  print(max(A))
else:
    left = max(A)
    right = 0
    ret = binary_search(right, left)
    print(ret)
n,k = int(input().split())
print((n+k-3)/(k-1))


### FIXED CODE ###

import math
n,k = map(int,input().split())
print(math.floor((n+k-3)/(k-1)))
import math
def:
	A B H M=map(int,input().split(" "))
	if H>M/5:
		angle=(H/12-M/60)*360
	else:
		angle=(M/60-H/12)*360
    t=cos(angle)
    d=(A^2+B^2-2AB*t)^0.5
    print(d)
    

### FIXED CODE ###

import math


def cal():
    string = input()
    a, b, h, m = string.split(" ")
    a = int(a)
    b = int(b)
    h = int(h)
    m = int(m)
    minuteAngel = (float(m) * 360) / 60
    hourAngel = (float(h) % 12) * 30 + (float(m) * 30) / 60
    angel = abs(hourAngel - minuteAngel)
    angel=angel/180
    cosine = math.cos(math.pi*angel)
    ans = math.sqrt(a*a + b*b - 2*a*b*cosine)
    print(format(ans, '.20f'))
    # print(angle1)
    # print(angle2)
    # print(angle)
    # print(cosine)

cal()
from sys import stdin
import numpy as np
h,w = map(int,stdin.readline().rstrip().split())
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(h)]
point = 0
lin = []
#まず行ごとにまとめて右に1つづつスライド
for i in range(h):
    for j in range(w-1):
        if li[i][j] %2 == 1:
            li[i][j] -= 1
            li[i][j+1] += 1
            lin.append([i+1,j+1,i+1,j+2])
            point += 1
#右端のを１つづつ下にスライド
for i in range(h-1):
    if li[i][w-1] %2 == 1:
        li[i][w-1] -= 1
        li[i+1][w-1] += 1
        lin.append([i+1,w,i+2,w])
        point += 1
print(point)
for i in lin:
    print(*i)

### FIXED CODE ###

from sys import stdin
h,w = map(int,stdin.readline().rstrip().split())
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(h)]
point = 0
lin = []
#まず行ごとにまとめて右に1つづつスライド
for i in range(h):
    for j in range(w-1):
        if li[i][j] %2 == 1:
            li[i][j] -= 1
            li[i][j+1] += 1
            lin.append([i+1,j+1,i+1,j+2])
            point += 1
#右端のを１つづつ下にスライド
for i in range(h-1):
    if li[i][w-1] %2 == 1:
        li[i][w-1] -= 1
        li[i+1][w-1] += 1
        lin.append([i+1,w,i+2,w])
        point += 1
print(point)
for i in lin:
    print(*i)