Harryxun/stf_run huggingface dataset:
import numpy as np
lis=[]
for i in range(101):
    lis.append(i)
lis.remove(0)

listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
#print(listA)

X_=listA[0]
X=X_[0]
N=X_[1]
if N!=0:
    P =listA[1]

    arr = np.array(lis)
    P_max = max(P)
    P_min = min(P)
    arr=arr[arr<=P_max]
    arr=arr[arr>=P_min]
    lis=arr.tolist()
    for p in P:
        lis.remove(p)
    #print(lis)
    lis_=[]
    for l in lis:
        lis_.append(abs(l-X))
    #print(lis_)
    lis_min=min(lis_)

    def my_index(l, x, default=False):
        if x in l:
            return l.index(x)
        else:
            return default

    print(lis[my_index(lis_, lis_min)])
else:
    print(X)

### FIXED CODE ###

import numpy as np
lis=[]
for i in range(102):
    lis.append(i)
#print(lis)
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
#print(listA)
 
X_=listA[0]
X=X_[0]
N=X_[1]
if N!=0:
    P =listA[1]
 
    arr = np.array(lis)
    P_max = max(P)
    P_min = min(P)-1
    arr=arr[arr<=P_max+1]
    arr=arr[arr>=P_min-1]
    lis=arr.tolist()
    for p in P:
        lis.remove(p)
    #print(lis)
    lis_=[]
    for l in lis:
        lis_.append(abs(l-X))
    #print(lis_)
    lis_min=min(lis_)
 
    def my_index(l, x, default=False):
        if x in l:
            return l.index(x)
        else:
            return default
 
    print(lis[my_index(lis_, lis_min)])
else:
    print(X)
N = int(input())
A = list(map(int, input().split()))
sm=0
mod=10**9+7
s=sum(A)
for i in range(A):
    s-=i
    sm+=i*s
    sm%=mod
print(sm)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
sm=0
mod=10**9+7
s=sum(A)
for i in A:
    s-=i
    sm+=i*s
    sm%=mod
print(sm)
import collections
import sys
input = sys.stdin.readline()
N = int(input())

ab = [list(map(int, input().split())) for i in range(N-1)]

eda = [set() for i in range(N)]

for a, b in ab:
    eda[a-1].add(b)
    eda[b-1].add(a)
max_e = 0
for i in range(N-1):
    max_e = max(max_e, len(eda[i]))
id = 0
for i in range(N):
    if len(eda) == max_e:
        id = i

ans = [1]*(N-1)
q = collections.deque()
q.append(id)
print(max_e)
eda2 = [set() for i in range(N)]
for a, b in ab:
    for i in range(1, max_e+1):
        if i not in eda2[a-1] and i not in eda2[b-1]:
            ans = i
            break
    print(ans)
    eda2[a-1].add(i)
    eda2[b-1].add(i)


### FIXED CODE ###

import collections
import sys
input = sys.stdin.readline
N = int(input())
ab = [list(map(int, input().split())) for i in range(N-1)]
eda = [set() for i in range(N)]
for a, b in ab:
    eda[a-1].add(b)
    eda[b-1].add(a)
max_e = 0
for i in range(N-1):
    max_e = max(max_e, len(eda[i]))
id = 0
for i in range(N):
    if len(eda[i]) == max_e:
        id = i

q = collections.deque([(id, 0)])
print(max_e)
d = dict()
for a, b in ab:
    d[(a-1, b-1)] = 0
    d[(b-1, a-1)] = 0
eda2 = [set() for j in range(N)]

g = [set() for i in range(N)]

for a, b in ab:
    g[a-1].add(b-1)
    g[b-1].add(a-1)


while(q):
    x, color = q.popleft()
    i = 1
    for y in g[x]:
        if i == color:
            i += 1
        d[(x, y)] = i
        d[(y, x)] = i
        g[y].remove(x)
        q.append((y, i))
        i += 1

for a, b in ab:
    print(d[(a-1, b-1)])
a = int(input())#一回にかかる料金
b = int(input())#所持している金額
c = int(input())#満足する回数
if b//a > c:
    print(c)
else:
    print(b//c)



### FIXED CODE ###

A, B, C = map(int, input().split())#入力された値を空白で区切ってその値をint型に変換して代入している
print(min(int(B / A), C))#intで囲うことで少数を切り捨てている
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
dbg = lambda *args, **kwargs: print(*args, **kwargs, file=sys.stderr)

MOD = 10 ** 9 + 7
N, M = inm()
X = inl()
Y = inl()
assert len(X) == N
assert len(Y) == M


def solve():
    xsum = [0] * N
    xsum[N - 1] = (X[N - 1] - X[N - 2]) % MOD
    for k in range(2, N):
        xsum[N - k] = xsum[N - k + 1] + k * (X[N - k] - X[N - k - 1])
        xsum[N - k] %= MOD

    # for i in range(N):
    #     dbg(f"> {i=} {xsum[i]=}")

    ysum = [0] * M
    ysum[M - 1] = (Y[M - 1] - Y[M - 2]) % MOD
    for k in range(2, M + 1):
        ysum[M - k] = ysum[M - k + 1] + k * (Y[M - k] - Y[M - k - 1])
        ysum[M - k] %= MOD

    # for j in range(M):
    #     dbg(f"> {j=} {ysum[j]=}")

    return sum(xsum[1:]) % MOD * (sum(ysum[1:]) % MOD) % MOD


print(solve())


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()

MOD = 10 ** 9 + 7
N, M = inm()
X = inl()
Y = inl()
assert len(X) == N
assert len(Y) == M


def solve():
    xsum = [0] * N
    xsum[N - 1] = (X[N - 1] - X[N - 2]) % MOD
    for k in range(2, N):
        xsum[N - k] = xsum[N - k + 1] + k * (X[N - k] - X[N - k - 1])
        xsum[N - k] %= MOD

    ysum = [0] * M
    ysum[M - 1] = (Y[M - 1] - Y[M - 2]) % MOD
    for k in range(2, M + 1):
        ysum[M - k] = ysum[M - k + 1] + k * (Y[M - k] - Y[M - k - 1])
        ysum[M - k] %= MOD

    return sum(xsum[1:]) % MOD * (sum(ysum[1:]) % MOD) % MOD


print(solve())
n=int(input())
a=sum([int(i) for i in input().split()]

print('YES' if a%2==0 else 'NO')

### FIXED CODE ###

n=int(input())
a=sum([int(i) for i in input().split()])

print('YES' if a%2==0 else 'NO')
import math
a, b,c = map(float, input().split())
if c - a - b > 0 or 4*a*b < (c - a - b)**2:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input()) - 1
print(L[K])
n = int(input())
v = list(map(int,input()))
c = list(map(int,input()))

total_v = 0

for i in range(n-1)
	if v[i] - c[i] > 0:
    	total_v += v[i] - c[i]
print(total_v)

### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

total_v = 0

for i in range(n):
  if v[i] - c[i] > 0:
    total_v += (v[i] - c[i])

print(total_v)
n=int(input());
num_list=[];
for i in range(n):
    num_list.append(int(input()));
    m=max(num_list)
for j in range(n):
    if(num_list[j]==m):
        num_list[j]=0;
        print(max(num_list))
    else:
        print(m);


### FIXED CODE ###

a=int(input());
print(3*a**2);
X = input()

if (X == “A”):
    print(“T”)
elif (X ==“T”):
    print(“A”)
elif (X == “G”):
    print(“C”)
else:
    print(“G”)


### FIXED CODE ###

X = input()

if (X == "A"):
    print("T")
elif (X =="T"):
    print("A")
elif (X == "G"):
    print("C")
else:
    print("G")
N = int(input())
S = list(input()+"")
#Dic={}
count=0

def ff(i,L):
    global count

    if(N>i):
        if(S[i] not in L):
            ff(i+1,L+S[i])
        ff(i+1,L)
    else:
        count += 1

ff(0,"")
print(count-1)

### FIXED CODE ###

n = int(input())
s = input()
l = {}
for c in s:
    if c in l:
        l[c] += 1
    else:
        l[c] = 1
ans = 1
for i in l.values():
    ans *= i+1
print((ans-1)%(10**9+7))
N, K = map(int, input().split())
S = set()

MOD = 998244353
for _ in range(K):
    L, R = map(int, input().split())
    S |= set(range(L, R + 1))
# print(f'{S=}')

DP = [-1] * (N + 1)
DP[0] = 0
DP[1] = 1


def f(idx):
    ans = 0
    for s in S:
        if idx - s < 0:
            continue
        if DP[idx - s] == -1:
            DP[idx - s] = f(idx - s)
        ans += DP[idx - s]
    return ans % MOD


ans = f(N)
# print(f'{DP=}')
print(ans)
# # 配るDP
# for i in range(1, N + 1):
#     for s in S:
#         DP[i + s] += DP[i]
#     print(f'{DP=}')
#     DP[i] %= MOD
# print(DP[N])


### FIXED CODE ###

N, K = map(int, input().split())
MOD = 998244353
LR = []
for _ in range(K):
    L, R = map(int, input().split())
    LR.append((L, R))
# print(f'{LR=}')

DP = [0] * (N + 1)
DP[1] = 1
S = [0] * (N + 1)

for i in range(1, len(DP)):
    for L, R in LR:
        v = S[max(i - L, 0)] - S[max(i - R - 1, 0)]
        DP[i] += v
    DP[i] %= MOD
    S[i] = (S[i - 1] + DP[i]) % MOD

# print(f'{DP=}')
# print(f'{S=}')
print(DP[-1])
N= int(input())
A= int(input())
B= int(input())

if N*A>B:
  print (B)
else: 
  print (N*A)

### FIXED CODE ###

N,A,B=map(int,input().split())
if N*A >=B:
  print (B)
else:
  print(N*A)
! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = input()
if S in "YAKI":
	print("Yes")

else:
	print("No")

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = input()

S = S[0:4]

if "YAKI" in S:
	print("Yes")

else:
	print("No")
from bisect import*
import sys;input=sys.stdin.readline

def doevent(lis):
    global stop
    a,b=lis
    if b>=0:
        if stop=={-1}:
            stop=set()
        stop.add(b)
    else:
        if -b in stop:
            stop.remove(-b)
        if stop==set():
            stop={-1}
    return min(stop)


def main():
    n,q=map(int,input().split())
    event=[]
    stop=set([-1])
    for i in range(n):
        s,t,x=map(int,input().split())
        event.append((s-x,x))
        event.append((t-x,-x))
    event.sort(key=lambda x:x[0])
    minlist=[doevent(i)for i in event] #時間をindexとしたminlist

    for i in range(q):
        print(minlist[bisect_right(event,(int(input()),10**9))-1])
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))
    
event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop
        
print('\n'.join(map(str, ans)))
K = int(input())
X = int(input())
for i in range(X-K+1,X+K):
    print(i)

### FIXED CODE ###

K, X = map(int, input().split())
for i in range(X-K+1,X+K):
	print(i)
import sys
input = sys.stdin.readline

n,Q=map(int,input().split())
bn = (n-1).bit_length()
b_num = 2**bn
mx = 10**9
segl=[mx]*2*b_num 

xs = []
for s, t, x in [[int(c) for c in input().split()] for _ in range(n)]:
    xs += [(s-x,0,x,i), (t-x,1,x,i)]
for _ in range(Q):
    xs.append((int(input()),2,0,0))
xs.sort()
ys = set()
for x in xs:
    if x[1]==2:
        for _ in range(bn):
            nys = set()
            ys = nys
        print(segl[0] if segl[0]!= mx else -1)
        ys = set()
        continue
    segl[x[3]+b_num-1] = mx if x[1] else x[2]
    ys.add((x[3]+b_num-2)//2)


### FIXED CODE ###

import sys
input = sys.stdin.readline

n,Q=map(int,input().split())
b_num = 2**(n-1).bit_length()
mx = 10**9
segl=[mx]*2*b_num 

def update( k, x):
    k += b_num-1
    segl[k] = x
    while k+1:
        k = (k-1)//2
        segl[k] = min(segl[k*2+1],segl[k*2+2])
    
if __name__ == '__main__':
    xs = []
    for i in range(n):
        s,t,x=map(int,input().split())
        xs += [(s-x-0.4,True,x,i), (t-x-0.5,False,x,i)]
    for _ in range(Q):
        xs.append((int(input()),2))
    xs.sort(key=lambda x:x[0])
    for x in xs:
        if x[1]==2:
            print(segl[0] if segl[0]!= mx else -1)
            continue
        update(x[3], x[2] if x[1] else mx)
import numpy as np

N, M = map(int, input().split())
holes = []
for i in range(M):
    holes.append(int(input())-1)

dp = np.zeros(N, dtype=np.int64)
dp[0] = 0 if 0 in holes else 1
dp[1] = 0 if 1 in holes else dp[0] + 1

for i in range(2, N):
    if i in holes:
        dp[i] = 0
    else:
        if (dp[i-2] == 0) & (dp[i-1] == 0):
            break
        else:
            dp[i] = dp[i-1] + dp[i-2]

mod = 1e9 + 7
print(int(dp[-1] % mod))

### FIXED CODE ###

def fib(num_steps):
    xb = 0
    xa = 1
    if num_steps == 0:
        return xa
    else:
        for i in range(num_steps):
            tmp = xa
            xa = xa + xb
            xb = tmp
    
    return xa

N, M = map(int, input().split())
ways = 1
now = 0

for i in range(M):
    hole = int(input())
    diff = (hole - 1) - now

    if diff < 0:
        ways *= 0
    else:
        ways *= fib(diff)

    now = hole + 1

if now < N:
    ways *= fib(N - now)

print(ways % 1000000007)
import sys
sys.setrecursionlimit(int(1e6))

def dfs(u, p = 0):
  for v in g[u]:
    if v != p:
      dfs(v, u)
  g[u] = None


n, m = map(int, input().split())
g = [list() for i in range(n + 1)]
for i in range(m):
  u, v = map(int, input().split())
  g[u].append(v)
  g[v].append(u)
c = 0
for i in range(1, n + 1):
  if g[i] is not None:
    c += 1
    dfs(i)
print(c - 1 if c else 0)


### FIXED CODE ###

import sys
sys.setrecursionlimit(int(2e6))

def dfs(u, p = 0):
  vis[u] = True
  for v in g[u]:
    if not vis[v]:
      dfs(v, u)

n, m = map(int, input().split())
assert 2 <= n <= int(1e5)
assert 1 <= m <= int(1e5)
g = [list() for i in range(n + 1)]
for i in range(m):
  u, v = map(int, input().split())
  assert 1 <= u <= int(1e5)
  assert 1 <= v <= int(1e5)
  assert u < v
  g[u].append(v)
  g[v].append(u)
c = 0
vis = [False] * (n + 1)
for i in range(1, n + 1):
  if not vis[i]:
    c += 1
    dfs(i)
print(c - 1)
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10**9)
mod = 10**9+7
N,Q = I()
graph = [-1]*N
roots = [[] for _ in range(N)]
for i in range(N-1):
    a,b = I()
    graph[b-1] = a-1
def dfs(a):
    if a == 0:
        return
    b = graph[a]
    roots[b].append(i)
    dfs(b)
for i in range(N-1,-1,-1):
    dfs(i)
counter = [0]*N
for i in range(Q):
  p,x = I()
  r = roots[p-1]
  counter[p-1] += x
  if r:
      for j in r:
          counter[j] += x
for c in counter:
    print(c)

### FIXED CODE ###

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10**9)
mod = 10**9+7
N,Q = I()
edge = [[] for _ in range(N)]
for _ in range(N-1):
    a,b = I()
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
ans = [0]*N
for _ in range(Q):
    p,x = I()
    ans[p-1] += x
que = [0]
visited = {0}
while que:
    p = []
    for i in que:
        for j in edge[i]:
            if j in visited:
                continue
            visited.add(j)
            ans[j] += ans[i]
            p.append(j)
    que = p
print(*ans)
while True:
    x,y = raw_input()
    x,y = map(int,(x,y))
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = map(str,(x,y))
        print x + " " + y
    else:
        x,y = map(str,(x,y))
        print y + " " + x

### FIXED CODE ###


while True:
    x,y = raw_input().split()
    x,y = map(int,(x,y))
    if x == 0 and y == 0:
        break
    if x > y:
        x,y = map(str,(x,y))
        print y + " " + x
    else:
        x,y = map(str,(x,y))
        print x + " " + y
import sys
for i in sys.stdin.readlines() :
    l = i.split()
    a = l[0]
    b = l[1]
    if a == 0 and b == 0 :
        break
    elif a > b
        print(b,a)
    else
        print(a,b)

### FIXED CODE ###

import sys
while True :
    ab = list(map(int,sys.stdin.readline().split()))
    a = ab[0]
    b = ab[1]
    if a == 0 and b == 0 :
        break
    else :
        ab = sorted(ab)
        print(ab[0],ab[1])
s=str(input())
S=''
for i in range(len(s))
    S+='x'
print(S)

### FIXED CODE ###

s=input()
print('x'*len(s))
import collections
n = int(input())
v = list(map(int, input().split()))
v1 = v[::2]
v2 = v[1::2]
c1 = collections.Counter(v1).most_common()
c2 = collections.Counter(v2).most_common()

if c1[0][0] != c2[0][0]:
  print(len(v1)-c1[0][1] + len(v2)-c2[0][1])
else:
  if len(set(v1)) == len(set(v2)) == 1:
    print(min(len(v1), len(v2)))
  elif len(set(v1))==1:
    print(len(v2)-c2[1][1])
  elif len(set(v2))==1:
    print(len(v1)-c1[1][1])
  else:
    print(min(len(v1)-c1[0][1]+len(v2)-c2[1][1]),
                len(v1)-c1[1][1]+len(v2)-c2[0][1])

### FIXED CODE ###

import collections
n = int(input())
v = list(map(int, input().split()))
v1 = [v[i*2+1] for i in range(n//2)]
v2 = [v[i*2] for i in range(n//2)]
c1 = collections.Counter(v1).most_common()
c2 = collections.Counter(v2).most_common()

if len(set(v1)) == len(set(v2)) == 1:
  if c1[0][0] != c2[0][0]:
    print(0)
  else:
    print(min(len(v1), len(v2)))
elif len(set(v1))==1:
  if c1[0][0] != c2[0][0]:
    print(sum([i[1] for i in c2])-c2[0][1])
  else:
    print(sum([i[1] for i in c2])-c2[1][1])
elif len(set(v2))==1:
  if c1[0][0] != c2[0][0]:
    print(sum([i[1] for i in c1])-c1[0][1])
  else:
    print(sum([i[1] for i in c1])-c1[1][1])
else:
  if c1[0][0] != c2[0][0]:
    print((sum([i[1] for i in c1])-c1[0][1]) + (sum([i[1] for i in c2])-c2[0][1]))
  else:
    print(min((sum([i[1] for i in c1])-c1[0][1])+(sum([i[1] for i in c2])-c2[1][1]),
              (sum([i[1] for i in c1])-c1[1][1])+(sum([i[1] for i in c2])-c2[0][1])))
import sys
n ,k = map(int, input().split())
m = 0

if n == k or k == 1:
    print(0)
    sys.exit()
    
def abs_N(n, k):
    m = abs(n-k)
    compare_N_M(n, m)

def compare_N_M(n, m):
    if m == 1:
        print(1)
        sys.exit()
    elif n >= m:
        n = m
        abs_N(n, k)
    else:
        print(n)
        sys.exit()
        

abs_N(n, k)


### FIXED CODE ###

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

print(c, a, b)
a=list(map(int,input.split()))
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))


### FIXED CODE ###

a=list(map(int,input().split()))
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))
S = str(input())
l = len(S)
a = int(0)
b= int(0)
ans = [0]*l
ansc=int(0)
ansv=int(0)
ansi=int(0)

newS = S.split('LR')

k = len(newS)

for i in range(k):
    if i ==0:
        a = newS[i].count('R')
        b = len(newS[i])-a
        ansc = (a+1)//2 + (b+1)//2
        ansv = a//2 + (b)//2 +1
        if 'RL' in newS[i]:
            ansi += newS[i].index('RL')
        else:
            ansi =0
        ans[ansi]=ansc
        ans[ansi+1]=ansv
        ansi += len(newS[i])

    elif i < k-1:
        a = newS[i].count('R')
        b = len(newS[i])-a
        ansc = (a)//2 + (b+1)//2 + 1
        ansv = (a+1)//2 + (b)//2 + 1
        if 'RL' in newS[i]:
            ansi += newS[i].index('RL')+1
        else:
            ansi +=1
        ans[ansi]=ansc
        ans[ansi+1]=ansv
        ansi += (len(newS[i])+1)
    else:
        a = newS[i].count('R')
        b = len(newS[i]) - a
        ansc = (a+1) // 2 + (b+1) // 2
        ansv = (a) // 2 + (b) // 2 + 1
        if 'RL' in newS[i]:
            ansi += newS[i].index('RL')+1
        else:
            ansi += 1
        ans[ansi] = ansc
        ans[ansi + 1] = ansv


print(' '.join(map(str, ans)))


### FIXED CODE ###

#from collections import deque
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7

S = str(input())
N = len(S)
ans = [0]*N
k = int(1)
R = []
L = []
rcount = int(1)
lcount = int(0)
lLocate = []
for i in range(1,N):
    if S[i]==S[i-1]:
        if k == 1:
            rcount +=1
        else:
            lcount +=1
    else:
        if k==1:
            R.append(rcount)
            lLocate.append(i-1)
            lcount = int(1)
        else:
            L.append(lcount)
            rcount = int(1)

        k *= (-1)


L.append(lcount)

#print(R)
#print(L)
#print(lLocate)
j = int(0)
#for i in range(N):
#    if i in lLocate:
for i in lLocate:
    r = R[j]
    l = L[j]
    ans[i] = (r+1)//2 + l//2
    ans[i+1] = r//2 + (l+1)//2
    j +=1

print(' '.join(map(str, ans)))
b0=input().split()
book=int(b0[0])
pro=int(b0[1])
norma=int(b0[2])

bl=[]
for x in range(book):
  bl.append([int(y) for y in input().split()])
  
def find(n,exl):
  if n==book:
    if min(exl)<norma:
      return -1
    else:
      return 0
  else:
    if min(exl)>=norma:
      return 0
    else:
      newexl=[]
      for i in range(pro):
        newexl.append(exl[i]+bl[n][i+1])
      if min(newexl)>=norma:
        f0=bl[n][0]
      else:
        re=find(n+1,newexl)
        if re==-1:
          f0=-1
        else:
          f0=re+bl[n][0]
      re2=find(n+1,exl)
      if re2==-1:
        f1=-1
      else:
        f1=re2
      if f0==-1 and f1==-1:
        return -1
      elif f0==-1 or f1==-1:
        return max(f0,f1)
      else:
        return min(f0,f1)
      
print(find(0,[0 for i in range(book)]))

### FIXED CODE ###

b0=input().split()
book=int(b0[0])
pro=int(b0[1])
norma=int(b0[2])

bl=[]
for x in range(book):
  bl.append([int(y) for y in input().split()])
  
mn=-1
for x in range(2**book):
  if book>9:
    k=str(book)+"b"
  else:
    k="0"+str(book)+"b"
  x2=format(x, k)
  m=0
  exl=[0 for i in range(pro)]
  for y in range(book):
    if x2[y]=="1":
      m+=bl[y][0]
      for j in range(pro):
        exl[j]+=bl[y][j+1]
  if min(exl)>=norma and (mn==-1 or mn>m):
    mn=m

print(mn)
import math
while 1:
    n = int(input())
    if n == 0:
        break
    lst = []
    for i in range(n+1,n*2+1,1):
        sum = 0
        if isinstance(math.sqrt(i),int) == False:
            x = math.floor(math.sqrt(i)) + 1
        else:
            x = math.sqrt(i) + 1
        for j in range(2,math.trunc(x)):
            if i%j == 0:
                sum += 1
        if sum == 0:
            lst.append(i)
    print len(lst)

### FIXED CODE ###

import math
while 1:
	n = int(input())
	if n == 0:
		break
	count = 0
	if n == 1:
		count = 1
		x = n + 2
	elif n % 2 == 1:
		x = n + 2
	elif n == 2:
		count = 1
		x = n + 1
	else:
		x = n + 1
	for i in range(x,n*2+1,2):
		y = math.trunc(math.sqrt(i))+3
		if y % 2 == 1:
			z = y-2
		else:
			z = y-1
		for j in range(3,y,2):
			if i % j == 0:
				break
			if j == z:
				count += 1
	print count
n = int(input())

l = list(map(int,input().split()))

s = l.sort()

ans = 0
if n <3:
  print(0)
else:
  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] > s[k] and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
          ans += 1
  print(ans)

### FIXED CODE ###

n = int(input())

l = list(map(int,input().split()))

l.sort()
ans = 0

if n < 2:
  print(0)
else:
  for i in range(n-2):
    for j in range(i+1,n-1):
      for k in range(j+1,n):
        if l[i] + l[j] > l[k] and l[i] < l[j] < l[k]:
          ans += 1
  print(ans)
price=list[map(int,input().split())]
k=[0.25,0.5,1.0,2.0]

N=int(input())

from itertools import permutations
ans=float("Inf")
for x in permutations([0,1,2,3]):
  tmp=0
  n=N
  for y in x:
    tmp+= (n//k[y])*price[y]
    n=n%k[y]
  ans=min(tmp,ans)
  
print(ans)
  
  

### FIXED CODE ###

from itertools import permutations
Q, H, S, D = map(int, input().split())
N = int(input())*4

ans = 0
s = [(Q, 1), (H, 2), (S, 4), (D, 8)]

ans = float("inf")
for x in permutations(s):
    tmp = 0
    n = N
    for a, b in x:
        tmp += (n // b)*a
        n %= b
    ans = min(ans, tmp)
print(ans)
N=input()
print(48-N)

### FIXED CODE ###

print(48-int(input()))
n, l = map(int, input().split())
words = []
for i in range(n):
  words.append(input())
print(''.join(words.sort()))

### FIXED CODE ###

n, l = map(int, input().split())
words = []
for i in range(n):
  words.append(input())
print(''.join(sorted(words)))
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
d=[a,b,c]
for i in d:
    if x in d[i] and y in d[i]:
        print('Yes')
        exit()
print('No')

### FIXED CODE ###

x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
d=[a,b,c]
for i in d:
    if x in i and y in i:
        print('Yes')
        exit()
print('No')