Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N,S=map(int,input().split())
ls=list(map(int,input().split()))
MOD=998244353
dp=[[1]+[0]*S for i in range(N+1)]
for i in range(N):
  for j in range(S+1):
    if ls[i]>j:
      dp[i+1][j]=dp[i][j]*2%MOD
    else:
      dp[i+1][j]=(dp[i][j]*2+dp[i][j-ls[i]])%MOD
print(dp[N][S])

### FIXED CODE ###

N,S=map(int,input().split())
ls=list(map(int,input().split()))
MOD=998244353
dp=[[1]+[0]*S for i in range(N+1)]
for i in range(N):
  for j in range(S+1):    
      dp[i+1][j]=dp[i][j]*2%MOD
      if ls[i]<=j:
        dp[i+1][j]=(dp[i+1][j]+dp[i][j-ls[i]])%MOD
print(dp[N][S])
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
del a[n:len(a)-1]
result = []
for i in range(n):
    print(a.count(i+1))


### FIXED CODE ###

import sys
import collections
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
for i in range(n):
    print(c[i+1])
### BUGGY CODE ###

#coding:utf-8
import bisect,math
import multiprocessing
A,B,Q=map(int,raw_input().split())
s=[0]*A
t=[0]*B
for i in range(A):
    s[i]=input()
for i in range(B):
    t[i]=input()
buf=[]
def f(x):
    sl=bisect.bisect_left(s,x)-1
    sr=sl+1
    tl=bisect.bisect_left(t,x)-1
    tr=tl+1
    ans=float("inf")
    if sl!=-1 and tl!=-1:
        A=max(s[sl],t[tl])
        B=min(s[sl],t[tl])
        L=abs(x-A)+abs(A-B)
        ans=min(ans,L)
    if sl!=-1 and tr!=len(t):
        L=abs(x-s[sl])*2 + abs(t[tr]-x)        
        ans=min(ans,L)
        ans=min(ans,abs(x-s[sl])+abs(t[tr]-x)*2)
    if tl!=-1 and sr!=len(s):
        ans=min(ans,abs(x-t[tl])*2+abs(s[sr]-x))
        ans=min(ans,abs(x-t[tl])+abs(s[sr]-x)*2)
    if tr!=len(t) and sr!=len(s):
        A=min(s[sr],t[tr])
        B=max(s[sr],t[tr])
        L=abs(A-x)+abs(B-A)
        ans=min(ans,L)
    return str(ans)

I=[0]*Q
for i in xrange(Q):
    I[i]=input()
r=map(f,I)
print("\n".join(r))
    
    




### FIXED CODE ###

#coding:utf-8
import bisect,sys
A,B,Q=map(int,raw_input().split())
s=[0]*A
t=[0]*B
for i in range(A):    
    s[i]=int(sys.stdin.readline())
for i in range(B):
    t[i]=int(sys.stdin.readline())
buf=[]
def f(x):
    sl=bisect.bisect_left(s,x)-1
    sr=sl+1
    tl=bisect.bisect_left(t,x)-1
    tr=tl+1
    ans=float("inf")
    if sl!=-1 and tl!=-1:
        A=max(s[sl],t[tl])
        B=min(s[sl],t[tl])
        L=abs(x-A)+abs(A-B)
        ans=min(ans,L)
    if sl!=-1 and tr!=len(t):
        L=abs(x-s[sl])*2 + abs(t[tr]-x)        
        ans=min(ans,L)
        ans=min(ans,abs(x-s[sl])+abs(t[tr]-x)*2)
    if tl!=-1 and sr!=len(s):
        ans=min(ans,abs(x-t[tl])*2+abs(s[sr]-x))
        ans=min(ans,abs(x-t[tl])+abs(s[sr]-x)*2)
    if tr!=len(t) and sr!=len(s):
        A=min(s[sr],t[tr])
        B=max(s[sr],t[tr])
        L=abs(A-x)+abs(B-A)
        ans=min(ans,L)
    return str(ans)

I=[0]*Q
for i in xrange(Q):
    I[i]=int(sys.stdin.readline())
r=map(f,I)
print("\n".join(r))
### BUGGY CODE ###

N = int(input())
S = input()
count = N
for i in range(N):
    count = min(count , S[:i].count("W") + S[i+1:].count("E"))
print(count)

### FIXED CODE ###

N = int(input())
S = input()
first = S.count("E")
Ecount = 0 
Wcount = 0
count = first
for i in range(N):
    if S[i] == "E":
        Ecount += 1
    else:
        Wcount += 1
    count = min(count , first - Ecount + Wcount)
print(count)
### BUGGY CODE ###

s = raw_input()
p = "ABC"
used = set()

while s != p:
    idx = 0
    c = [0]*3
    while idx < len(s):
        if idx+3 <= len(s) and s[idx:idx+3] == p:
            idx += 3
        else:
            c[p.index(s[idx])] += 1
            idx += 1
    if sum(e == 0 for e in c) != 1 or sum(c) == s:
        print "No"
        exit(0)
    s = s.replace("ABC", p[[i for i in [0,1,2] if c[i]==0][0]])
print "Yes"

### FIXED CODE ###

s = raw_input()
p = "ABC"
used = set()

while s != p:
    idx = 0
    c = [0]*3
    while idx < len(s):
        if idx+3 <= len(s) and s[idx:idx+3] == p:
            idx += 3
        else:
            c[p.index(s[idx])] += 1
            idx += 1
    if sum(e == 0 for e in c) != 1 or sum(c) == len(s):
        print "No"
        exit(0)
    s = s.replace("ABC", p[[i for i in [0,1,2] if c[i]==0][0]])
print "Yes"
### BUGGY CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(50000)

tree = {}
edges = []
colors = set()
N = 0

def readlines(n):
    for _ in range(n):
        a, b = map(int, input().split())
        yield a, b

def to_tree(edges_, n):
    tree_ = {i:[] for i in range(1,n+1)}
    for a, b in edges_:
        tree_[a].append(b)
    return tree_

def assign(assignment, u, prev_color):
    lest_colors = colors - {prev_color}
    for v, color in zip(tree[u], lest_colors):
        assignment[u,v] = color
        assign(assignment, v, color)

def main():
    global tree, edges, colors, N
    N = int(input())
    colors = set(range(1,N))
    edges = tuple(readlines(N-1))
    tree = to_tree(edges, N)
    ans = {}
    assign(ans, 1, None)
    print(max(ans.values()))
    for edge in edges:
        print(ans[edge])

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

tree = {}
N = 0

def assign(assignment, u, prev_color):
    color = 1
    for v in tree[u]:
        if color == prev_color:
            color += 1
        assignment[u,v] = color
        assign(assignment, v, color)
        color += 1

def main():
    global tree, N
    N = int(input())
    tree = {i: [] for i in range(1,N+1)}
    edges = []
    for _ in range(N-1):
        a, b = map(int, input().split())
        tree[a].append(b)
        edges.append((a, b))
    ans = {}
    assign(ans, 1, None)
    print(max(ans.values()))
    for edge in edges:
        print(ans[edge])

if __name__ == "__main__":
    main()
### BUGGY CODE ###

n, k = map(int, input().split())
L = []
if n > k:
  n = n - k*(n//k)
 
for i in range(k+1):
  L.append(abs(n-k))
  n = abs(n-k)
  
print(min(L))  

### FIXED CODE ###

n, k = map(int, input().split())
L = []
if n > k:
  n = n - k*(n//k)
 
if n*2 <= k:
  print(n)
else:
  print(k-n)
### BUGGY CODE ###

n = int(input())
lis = list(map(int, input().split()))
for i in range(n):
    print(lis.count(i+1))


### FIXED CODE ###

n = int(input())
lis = list(map(int, input().split()))
dic = {}
for i in lis:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] =1
for i in range(1, n + 1):
    print(dic.get(i, 0))
### BUGGY CODE ###

import copy
N = int(input())
S = input()

List = []
List.append(S[0:3])
for i in range(3,N):
    cnt = 0
    List0 = copy.copy(List)
    for s in List0:
        for j in range(len(s)):
            if s[0:j]+s[j+1:N]+S[i] not in List:
                List.append(s[0:j]+s[j+1:N]+S[i])

print(len(List))


### FIXED CODE ###

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

def judge(S,A): #A:3桁ｎ数字
    dig,pt = 0,0
    while dig < 3 and pt < N:
        if S[pt] == A[dig]:
            dig += 1
            pt += 1
        else:
            pt += 1
        if dig == 3:
            break

    if dig == 3:
        return True
    else:
        return False

count = 0
for a in range(10):
    for b in range(10):
        for c in range(10):
            if judge(S,[str(a),str(b),str(c)]):
                count += 1

print(count)
### BUGGY CODE ###

import math
from collections import defaultdict

N = int(input())
AB = [tuple(map(int, input().split())) for _ in range(N)]
MOD = 10**9 + 7

d = defaultdict(int)
cnt_00 = 0
cnt_0b = 0
cnt_a0 = 0
for a,b in AB:
    if a == b == 0:
        cnt_00 += 1
    elif a == 0:
        cnt_a0 += 1
    elif b == 0:
        cnt_0b += 1
    else:
        num_gcd = math.gcd(a,b)
        grad = 1 if a * b > 0 else -1

        d[(grad, abs(a // num_gcd), abs(b // num_gcd))] += 1

ks = tuple(d.keys())

ans = 1
for k in ks:
    if d[k] == 0:
        continue
    
    grad, a, b = k[0], k[1], k[2]
    if (-grad, b, a) in ks:
        
        # 傾き a/bのものを一つ以上選ぶ場合（-b/aは選ばない） + -b/aから一つ以上選ぶ場合（a/bは選ばない） + どちらからも選ばない場合
        ans *= (pow(2, d[(grad, a, b)], MOD)-1) + (pow(2, d[(-grad, b, a)], MOD)-1) + 1
        ans %= MOD
        d[(grad, a, b)] = 0
        d[(-grad, b, a)] = 0
    else:
        # a/bから0個以上選ぶ場合
        ans *= pow(2, d[(grad, a, b)], MOD)
        ans %= MOD
        d[(grad, a, b)] = 0

# a,bの一方のみ0の場合 + どちらからも選ばない場合
ans *= (pow(2, cnt_a0, MOD)-1) + (pow(2, cnt_0b, MOD)-1) + 1
ans %= MOD

# 0,0のみを１つだけ入れる場合
ans += cnt_00
# なにも選ばない場合を除く
ans -= 1

ans %= MOD

print(ans)

### FIXED CODE ###

from math import gcd
from collections import defaultdict

N = int(input())
AB = [tuple(map(int, input().split())) for _ in range(N)]
MOD = 10**9 + 7

d = defaultdict(int)
cnt_00 = 0
cnt_0b = 0
cnt_a0 = 0
for a,b in AB:
    if a == b == 0:
        cnt_00 += 1
    elif a == 0:
        cnt_a0 += 1
    elif b == 0:
        cnt_0b += 1
    else:
        num_gcd = gcd(a,b)
        grad = 1 if a * b > 0 else -1
        a //= num_gcd
        b //= num_gcd
        d[(grad, abs(a), abs(b))] += 1



ans = 1
for k in d.keys():
    if d[k] == 0:
        continue
    
    grad, a, b = k[0], k[1], k[2]
    if (-grad, b, a) in d:
        
        # 傾き a/bのものを一つ以上選ぶ場合（-b/aは選ばない） + -b/aから一つ以上選ぶ場合（a/bは選ばない） + どちらからも選ばない場合
        ans *= (pow(2, d[(grad, a, b)], MOD)-1) + (pow(2, d[(-grad, b, a)], MOD)-1) + 1
        ans %= MOD
        d[(grad, a, b)] = 0
        d[(-grad, b, a)] = 0
    else:
        # a/bから0個以上選ぶ場合
        ans *= pow(2, d[(grad, a, b)], MOD)
        ans %= MOD
        d[(grad, a, b)] = 0

# a,bの一方のみ0の場合 + どちらからも選ばない場合
ans *= (pow(2, cnt_a0, MOD)-1) + (pow(2, cnt_0b, MOD)-1) + 1
ans %= MOD

# 0,0のみを１つだけ入れる場合
ans += cnt_00
# なにも選ばない場合を除く
ans -= 1

ans %= MOD

print(ans)
### BUGGY CODE ###

a,b,k = map(int,input().split())
if max(a,b,k) == k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,b+1):
        if abs(i-a)<k or abs(i-b)<k:
            print(i)

### FIXED CODE ###

a,b,k = map(int,input().split())
if b-a<2*k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
### BUGGY CODE ###


  
n = int(input())
if n%2==0:
  print(-1)
  exit()
#print(n_list)
seven = 7
while True:
  if n<=seven and seven%n==0:
    print(len(str(seven)))
    exit()
  seven = int(str(seven)+'7')
print(-1)

### FIXED CODE ###

k = int(input())

if k%2==0 or k%5==0:
  print(-1)
  exit()

mod = 7
cnt = 1
while True:
  if mod%k==0:
    print(cnt)
    exit()
    
  mod *= 10
  mod += 7
  cnt += 1
  mod %= k
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(len(a)):
    if i%2 == 0:
        b.append(str(a[i]))
    else:
        b.insert(0,str(a[i]))
if n%2 != 0:
    b.reverse()
    print(*b)
else:
    print(*b)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []
ans1 = a[0::2]
ans2 = a[1::2]
if n%2 == 0:
    ans2.reverse()
    b.extend(ans2)
    b.extend(ans1)
    print(*b)
else:
    ans1.reverse()
    b.extend(ans1)
    b.extend(ans2)
    print(*b)
### BUGGY CODE ###

#d
import itertools
n=int(input())
ans=0
num=[str(i) for i in range(1,n+1)]
for i in num:
    for j in num:
        if i[0]==j[-1] and i[-1]==j[0]:
            ans+=1
print(ans)

### FIXED CODE ###

#abc152 d
n=int(input())

def first_num(x):
    l=x
    while int(x/10)>0:
        x=int(x/10)
        l=x
    return l

kiroku=dict()
for i in range(1,n+1):
    first=first_num(i)
    last=i%10
    #組はタプルに入ってる
    if (first,last) in kiroku:
        kiroku[first,last]+=1
    else:
        kiroku[first,last]=1

ans=0
for key in kiroku.keys():
    f,l=key
    if (l,f) in kiroku:
        kumi=kiroku[f,l]*kiroku[l,f]
        ans+=kumi
print(ans)
### BUGGY CODE ###

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

MOD = 998244353

dp0 = [[0] * (D + 1) for _ in range(C + 1)]
dp1 = [[0] * (D + 1) for _ in range(C + 1)]


dp0[A][B] = 1

for x in range(A, C + 1):
    for y in range(B, D + 1):
        if x == A and y == B:
            continue
        dp0[x][y] = (dp0[x][y - 1] * x + dp1[x][y - 1] * 1) % MOD
        dp1[x][y] = (dp0[x - 1][y] * y + dp1[x - 1][y] * y) % MOD

# print (dp0)
# print (dp1)        

ans = (dp0[C][D] + dp1[C][D]) % MOD
print (ans)

### FIXED CODE ###

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

MOD = 998244353

dp0 = [[0] * (D + 1) for _ in range(C + 1)]
dp1 = [[0] * (D + 1) for _ in range(C + 1)]


dp0[A][B] = 1

for x in range(A, C + 1):
    for y in range(B, D + 1):
        if x == A and y == B:
            continue
        dp0[x][y] = (dp0[x][y - 1] * x + dp1[x][y - 1] * 1) % MOD
        dp1[x][y] = (dp0[x - 1][y] * y + dp1[x - 1][y] * y) % MOD

# print (dp0)
# print (dp1)        

ans = (dp0[C][D] + dp1[C][D]) % MOD
print (ans)
### BUGGY CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10**8)

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

X = list(map(int,input().split()))
X = [abs(i-x) for i in X]
# print(X)

def gcd(m,n):
    mx = max(m,n)
    mn = min(m,n)
    tmp = mx%mn
    if tmp == 0:
        return mn
    else:
        return gcd(mn, tmp)

def gcd_list(data):
    if len(data)==1:
        return data[0]
    tmp = gcd(data[0], data[1])
    if len(data)==2:
        return tmp
    else:
        new_data = [tmp]+data[2:]
        return gcd_list(new_data)

# print(gcd_list([2,4,8]))
print(gcd_list(X))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)

from fractions import gcd

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

X = list(map(int,input().split()))
X = [abs(i-x) for i in X]
# print(X)

# def gcd(m,n):
#     mx = max(m,n)
#     mn = min(m,n)
#     tmp = mx%mn
#     if tmp == 0:
#         return mn
#     else:
#         return gcd(mn, tmp)

def gcd_list(data):
    # if len(data)==1:
    #     return data[0]
    # tmp = gcd(data[0], data[1])
    # if len(data)==2:
    #     return tmp
    # else:
    #     new_data = [tmp]+data[2:]
    #     return gcd_list(new_data)
    ret = data[0]
    for d in data[1:]:
        ret = gcd(ret, d)
    return ret
# print(gcd_list([2,4,8]))
print(gcd_list(X))
### BUGGY CODE ###

#import numpy as np
import sys
from collections import defaultdict
import math
import itertools
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000)

N = int(readline())
tmp = list(map(int,input().split()))
A = []  
[bisect.insort_right(A, x) for x in tmp]
tmp = list(map(int,readline().rstrip().split()))
B = []
[bisect.insort_right(B,x) for x in tmp ]
tmp = list(map(int,readline().rstrip().split()))
C = []
[bisect.insort_right(C,x) for x in tmp]

ans = 0
for a in A :
    indexb = bisect.bisect_right(B,a)
    if indexb == N :
        break
    for ib in range( indexb , N):
        indexc = bisect.bisect_right(C,B[ib])
        if indexc == N :
            break
        ans += (N-indexc)

print(ans)

### FIXED CODE ###

#import numpy as np
import sys
from collections import defaultdict
import math
import itertools
import bisect
read = sys.stdin.buffer.read
readline = sys.stdin.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000)

N = int(readline())
A = list(map(int,input().split()))
#A = []  
#[bisect.insort_right(A, x) for x in tmp]
B= list(map(int,readline().rstrip().split()))
#B = []
#[bisect.insort_right(B,x) for x in tmp ]
C = list(map(int,readline().rstrip().split()))
#C = []
#[bisect.insort_right(C,x) for x in tmp]

A.sort()
C.sort()

ans = 0
for b in B :
    indA = bisect.bisect_left(A,b)
    indC = bisect.bisect_right(C,b)
    ans += indA * (N-indC)

print(ans)
### BUGGY CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

def F2_GaussJordan(A, is_extended = False):
    rank = 0
    for col in range(len(A[0])):
        if (is_extended and col == len(A[0])-1):
            break
        pivot = -1
        for row in range(rank,len(A)):
            if A[row][col]:
                pivot = row
                break
        if pivot == -1: 
            continue
        A[pivot],A[rank] = A[rank],A[pivot]
        for row in range(rank+1,len(A)):
            if A[row][col]:
                A[row] = [A[row][j]^A[rank][j] for j in range(len(A[0]))]
        rank += 1
    return A

N = I()
A = III()

xor = 0
for i in range(N):
    xor ^= A[i]

max_digit = len(format(max(A), 'b'))

use_digit = []
ans = 0
for j in range(max_digit)[::-1]:
    if xor>>j & 1:
        ans += 2**j
    else:
        use_digit.append(j)

a = [[0]*max_digit for _ in range(N)]
k = 0
for k,j in enumerate(use_digit):
    for i in range(N):
        if A[i]>>j & 1:
            a[i][k] = 1

g = F2_GaussJordan(a,False)

s = 0
for i in range(N):
    s = max(s,s^sum([g[i][j]*2**use_digit[j] for j in range(len(use_digit))]))
ans += 2*s

print(ans)

### FIXED CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

N = I()
A = III()

xor = 0
for i in range(N):
    xor ^= A[i]

for i in range(N):
    A[i] &= ~xor

max_digit = len(format(max(A), 'b'))
rank = 0
for col in range(max_digit)[::-1]:
    pivot = -1
    for row in range(rank,N):
        if A[row]>>col & 1:
            pivot = row
            break
    if pivot == -1: 
        continue
    A[pivot],A[rank] = A[rank],A[pivot]
    for row in range(rank+1,N):
        if A[row]>>col & 1:
            A[row] ^= A[rank]
    rank += 1

val = 0
for i in range(N):
    val = max(val,val^A[i])

print(2*val + xor)
### BUGGY CODE ###

n=int(input())
ls=list(map(int,input().split()))
ls.sort()
ls.reverse()
ans=1
for i in range(n):
    ans=ans*ls[i]
if ans>10**18:
    ans=-1
print(ans)


### FIXED CODE ###

n=int(input())
ls=list(map(int,input().split()))
ans=1
for i in range(n):
    if ls[i]==0:
        print(0)
        quit()
for i in range(n):
    if ans>10**18:
        ans=-1
        break
    ans=ans*ls[i]
if ans>10**18:
    ans=-1
print(ans)
### BUGGY CODE ###

def main():
    MOD = 7 + 10**9
    S = list(input())
    N = len(S)
    dp = [[0]*13 for _ in range(N)]
    if S[N-1] == '?':
        for m in range(10):
            dp[0][m] = 1
    else:
        tm = int(S[N-1])%13
        dp[0][tm] = 1
    for i in range(1,N):
        if S[N-1-i] == '?':
            for j in range(13):
                dp[i][j] += sum([dp[i-1][(j-(k*10**i)%13)%13]%MOD for k in range(10)])
        else:
            m = (int(S[N-1-i])*10**i) % 13
            for l in range(13):
                dp[i][l] += dp[i-1][(l-m)%13]
    print(dp[N-1][5]%MOD)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    MOD = 7 + 10**9
    S = tuple(input())
    N = len(S)
    dp = [[0]*13 for _ in range(N+1)]
    dp[0][0] += 1
    s=[1]
    for n in range(1,N):
        s.append((s[n-1]*10)%13)
    for i in range(N):
        for k in range(13):
            if S[-(i+1)] != '?':
                dp[i+1][(k+int(S[-(i+1)])*s[i])%13] += dp[i][k] 
                dp[i+1][(k+int(S[-(i+1)])*s[i])%13] %= MOD
            else:
                for l in range(10):
                    dp[i+1][(k+l*s[i])%13] += dp[i][k]
                    dp[i+1][(k+l*s[i])%13] %= MOD
    print(dp[-1][5])

if __name__ == '__main__':
    main()
### BUGGY CODE ###

num,renzoku=map(int,input().split())
dices=list(map(int,input().split()))
max_renzoku=[]
for i in range(0,num-renzoku+1):
  max_renzoku.append(sum(dices[i:i+renzoku]))
print((max(max_renzoku)+renzoku)/2)


### FIXED CODE ###

num,renzoku=map(int,input().split())
dices=list(map(int,input().split()))
expects=[0]*num
for i in range(num):
  pi=dices[i]
  expects[i]=(1+pi)/2
Si=[0]*(num+1)
for i in range(1,num+1):
  Si[i]=Si[i-1]+expects[i-1]
max_Si=0
for i in range(0,num-renzoku+1):
  if max_Si<Si[i+renzoku]-Si[i]:
    max_Si=Si[i+renzoku]-Si[i]
print(max_Si)
### BUGGY CODE ###

s=int(input())
t=[list(map(int, input().split())) for i in range(s)]
t.sort()
u=[]
u.append(0)
a=t[0][0]+t[0][1]
for j in range(1,s):
  c=t[j][0]-t[j][1]
  if a<=c:
    a=t[j][0]+t[j][1]      
  else:
    a=t[j][0]+t[j][1]
    u.append(j)
d=0
for l in u:
  e=0
  for i in range(l,s):
    if i==l:
      a=t[i][0]+t[i][1]
      e+=1
    else:
      c=t[i][0]-t[i][1]
      if a<=c:
        e+=1
        a=t[i][0]+t[i][1]
  d=max(d,e)
print(d)

### FIXED CODE ###

s=int(input())
t=[]
for i in range(s):
    u,l=map(int,input().split())
    t.append((u-l,u+l-1))
t.sort(key=lambda x: x[1])
d=-10**10
ans=0
for i in range(s):
  if d<t[i][0]:
    ans+=1
    d=t[i][1]
print(ans)
### BUGGY CODE ###

N = int(input())
X = list(map(int, input().split()))
sum = 1000000 ** 10000000
for i in range(1, 101):
  tmp = 0
  for x in X:
    tmp += (x - i) ** 2
  if tmp < sum:
    sum = tmp
    ans = i
print(ans)

### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
sum = 1000000
for i in range(1, 101):
  tmp = 0
  for x in X:
    tmp += (x - i) ** 2
  sum = min(sum, tmp)
print(sum)
### BUGGY CODE ###

# 7,12,18
# ありうるのは、(7,17),(12,12),(8,16)
# ......AC...B...CA.......
# 7,12,16を選んだとき
# ......A_...B...C_.......
# BとCの差が4時間になる
# 17,12,8でもよい
# ......_C...B..._A.......
# 50人存在するが、時刻は0-23の24通り (ただし高橋くんは0固定なので、それ以外の人は23通り)
# N = 24人になったら鳩ノ巣理論により必ず誰かが同じ時刻になるため、答えは0
# 23人以下の場合は、全組み合わせ（2^23 = (10 ** 6) * 8）を試せば良い

N = int(input())
D = list(map(int,input().split()))
D = sorted(D,key = lambda x:min(x,24-x)) # ソートにより同時刻が固まるとループを抜けやすくなる？

if N >= 24:
  print(0)
  exit(0)
# 23桁のbit文字列で0の場合はそのまま、1の場合はひっくり返す（24-D[i]）
# []24桁のリスト(0は高橋くんがいるため初めから1人)に、人数を加算していく
# あるindexですでに人がいたらその時点で答えは0になる
# 最小値を更新していく
ans = 0

for i in range(2 ** N):
  data = [0] * 25
  data[0] = 1 # 高橋くん
  data[24] = 1 # 高橋くん
  for j in range(N):
    if (i >> j)&1:
      if data[24-D[j]] == 1:# 同時刻に既に誰かいた時点で最小値は0確定
        break
      data[24-D[j]] += 1
    else:
      if data[D[j]] == 1: # この時点で最小値は0確定
        break
      data[D[j]] += 1
  else:
    # 最小値が0でない場合
    minval = 24
    lastexist = 0
    for j in range(1,len(data)):
      if data[j]:
        if j - lastexist < minval:
          minval = j - lastexist
        lastexist = j
    if minval > ans:
      ans = minval
print(ans)


### FIXED CODE ###

# 7,12,18
# ありうるのは、(7,17),(12,12),(8,16)
# ......AC...B...CA.......
# 7,12,16を選んだとき
# ......A_...B...C_.......
# BとCの差が4時間になる
# 17,12,8でもよい
# ......_C...B..._A.......
# 50人存在するが、時刻は0-23の24通り (ただし高橋くんは0固定なので、それ以外の人は23通り)
# N = 24人になったら鳩ノ巣理論により必ず誰かが同じ時刻になるため、答えは0
# 23人以下の場合は、全組み合わせ（2^23 = (10 ** 6) * 8）を試せば良い

N = int(input())
D = list(map(int,input().split()))
D = sorted(D,key = lambda x:min(x,24-x)) # ソートにより同時刻が固まるとループを抜けやすくなる？

if N >= 24:
  print(0)
  exit(0)
# 23桁のbit文字列で0の場合はそのまま、1の場合はひっくり返す（24-D[i]）
# []24桁のリスト(0は高橋くんがいるため初めから1人)に、人数を加算していく
# あるindexですでに人がいたらその時点で答えは0になる
# 最小値を更新していく
ans = 0

for i in range(2 ** N):
  data = [0] * 25
  data[0] = 1 # 高橋くん
  data[24] = 1 # 高橋くん
  for j in range(N):
    if (i >> j)&1:
      if data[24-D[j]] == 1:# 同時刻に既に誰かいた時点で最小値は0確定
        break
      data[24-D[j]] += 1
    else:
      if data[D[j]] == 1: # この時点で最小値は0確定
        break
      data[D[j]] += 1
  else:
    # 最小値が0でない場合
    minval = 24
    lastexist = 0
    for j in range(1,len(data)):
      if data[j]:
        if j - lastexist < minval:
          minval = j - lastexist
        lastexist = j
    if minval > ans:
      ans = minval
print(ans)