Harryxun/stf_run huggingface dataset:
N = int(input())

point = [0] * N
dist = [0] * N
absolute = lambda x : x if x >= 0 else -x

for i in range(N) :
    x, y = map(int, input().split())
    point[i] = (x, y)
    dist[i] = absolute(x) + absolute(y)

maxDist = dist[0]
mask = maxDist % 2

for i in range(1, N) :
    if dist[i] % 2 != mask :
        break
    maxDist = max(maxDist, dist[i])
else :  # 実現可能
    print(maxDist) # 腕の数
    out = [1] * maxDist
    print(*out)

    for i, (x, y) in enumerate(point) :
        if x < 0 :
            holizon = ['L'] * absolute(x)
        elif x > 0 :
            holizon = ['R'] * absolute(x)
        else :
            holizon = ['']

        if y < 0 :
            vertical = ['D'] * absolute(y)
        elif y > 0 :
            vertical = ['U'] * absolute(y)
        else :
            vertical = ['']

        R = (maxDist - dist[i]) // 2
        if R > 0 :
            last = ['LR'] * R
        else :
            last = ['']

        print(''.join(holizon + vertical + last))



### FIXED CODE ###

N=int(input())

point = []
parity = {}
for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    parity[(x + y) % 2] = 1

if len(set(parity)) == 2 :
    print('-1')
else :
    m = 38
    parity = 1 if (1 in parity) else 0
    print(m + 1 - parity)
    if parity == 1 :  # 距離が奇数
        print(*[1 << i for i in range(m)])
    else :
        print(1, *[1 << i for i in range(m)])

    def arm(x, y, m) :
        if abs(x) >= abs(y) :
            if x >= 0 :
                return ('R', x - (1<<m), y)
            else :
                return ('L', x + (1<<m), y)
        else :
            if y >= 0 :
                return ('U', x, y - (1<<m))
            else :
                return ('D', x, y + (1<<m))

    for x, y in point :
        ans = []
        for i in range(m-1, -1, -1) :
            mode, x, y = arm(x, y, i)
            ans.append(mode)
        if parity == 0 :  # 偶数の場合一つ足す
            if x == 1 :
                ans.append('R')
            elif x == -1 :
                ans.append('L')
            elif y == 1 :
                ans.append('U')
            elif y == -1 :
                ans.append('D')
        print(''.join(ans[::-1]))
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
 
N, M = mi()
#Q = li2(M)
 
#Q = sorted(Q, key=lambda x:x[0])
 
table = dp2(0, N, N)
 
for i in range(M):
    s, t = mi()
    table[s-1][t-1] = 1
 
for i in reversed(range(N-1)):
    for j in range(i, N):
        table[i][j] = max(table[i+1][j], table[i][j])
 
#print(table)
 
i = j = 0
cnt = 0
while True:
    while j < N and table[i][j] == 0:
        j += 1
    if j >= N:
        break
    cnt += 1
    i = j
 
print(cnt)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, M = mi()
Q = li2(M)
#Q = sorted(Q, key=lambda x:x[1])

l = [N]*N
for i in range(M):
    ind = max(0, Q[i][0]-1)
    l[ind] = min(Q[i][1]-1, l[ind])

for i in reversed(range(N-1)):
    l[i] = min(l[i], l[i+1])

cnt = 0
i = 0
#print(l)
while True:
    i = l[i]
    cnt += 1
    if l[i] == N:
        break

print(cnt)
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0; i < n; i++)
typedef long long ll;
#define repran(i, a,b) for (int i = a; i<b;i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using LP = pair<ll,ll>;
using P = pair<int,ll>;
int n;
ll inf = 1e18;

int main()
{
    int n ,q;
    cin >> n >> q;
    vector<vector<int>> G(n, vector<int>());
    rep(i, n-1){
        int a, b;
        cin >> a >> b;
        --a;--b;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    vector<ll> ans(n, 0);
    vector<ll> acc(n, 0);
    rep(i, q){
        int p; ll x;
        cin >> p >>x;
        --p;
        acc[p] += x;
    }
    //dfs
    deque<P> deq;
    deq.emplace_back(0, acc[0]);
    ans[0] = acc[0];
    vector<int> parent(n, -1);
    while(!deq.empty()){
        P now = deq.back();deq.pop_back();
        int node = now.first;
        ll cost = now.second;
        for (int child : G[node]){
            if(child == parent[node]) continue;
            parent[child] = node;
            ans[child] = ans[node]+acc[child];
            deq.emplace_back(child, acc[child]);
        }

    }
    rep(i, n) cout << ans[i] << endl;

}

### FIXED CODE ###

def main():
    import sys

    def input(): return sys.stdin.readline().rstrip()

    n, q = map(int, input().split())
    adj = [[] for _ in range(n)]
    for _ in range(n-1):
        a, b = map(lambda x: int(x)-1, input().split())
        adj[a].append(b)
        adj[b].append(a)
    ans = [0]*n
    for _ in range(q):
        p, x = map(int, input().split())
        p -=1
        ans[p] += x
    
    from collections import deque
    que = deque([0])
    parent = [-1]*n
    while que:
        node = que.pop()
        for v in adj[node]:
            if v == parent[node]:
                continue
            parent[v] = node
            que.append(v)
            ans[v] += ans[node]
    for a in ans:
        print(a)

        

    
if __name__ == '__main__':
    main()
import numpy as np
n=input()
data=list(map(int,input().split()))
is_i=0
num=sorted(data)
count=num[1]
if num[0]!=num[1]:
    if any([x%num[2]!=0 for x in data[1::]])==True:
        count=int(num[1]/2)+1
else:
    if any([x%num[2]!=0 for x in data[1::]])==True:
        count=int(num[1]/2)+1
for i in range(count+1)[::-1]:
    is_i=0
    if all([x%i==0 for x in data]):
        print(i)
        break
    else:
        for j in range(len(data)):
            if data[j]%i!=0:
                is_i+=1
        if is_i==1:
            print(i)
            break

### FIXED CODE ###

from fractions import gcd
import numpy as np
n=int(input())
data=list(map(int,input().split()))
left=np.zeros(n+1,dtype=np.int)
right=np.zeros(n+1,dtype=np.int)
kotae=1
for i in range(n):
    left[i+1]=gcd(left[i],data[i])
    right[n-i-1]=gcd(right[n-i],data[n-i-1])
for j in range(n):
    num=gcd(left[j],right[j+1])
    kotae=max(num,kotae)
print(kotae)
n = int(input())

ans = 'Yes'

w = []

for i in range(n):
	a = input()
	if a in w:
		ans = 'No'
	else:
		w.append(a)

if n == 2:
	if w[0][-1] != w[1][0]:
		ans = 'No'
elif n == 3:
	if w[0][-1] != w[1][0]:
		ans = 'No'
	if w[1][-1] != w[2][0]:
		ans = 'No'
else:
	for i in range(1,n-2):
		print(i)
		if b[-1] == w[i][0]:
			b = w[i]
		else:
			ans = 'No'
print(ans)


### FIXED CODE ###

n = int(input())

ans = 'Yes'

w = []

for i in range(n):
	a = input()
	if a in w:
		ans = 'No'
	else:
		w.append(a)
b = w[0]
c = w[1:]
for i in c:
	if i[0] == b[-1]:
		b = i
	else:
		ans = 'No'
		break
print(ans)
n, a, b, k = [int(i) for i in input().split()]
p = 998244353

def fact(n, p):
    n_ = 1
    yield n_
    for i in range(1, n+1):
         n_ = (n_*i) % p
         yield n_

def invfact(n, f, p):
    m = pow(f[n], p-2, p)
    yield m
    for i in range(n, 0, -1):
        m = m * i % p
        yield m

f = list(fact(n+1, p))
rf = list(invfact(n+1, f, p))
rf.reverse()
ans = 0

for x in range(n+1):
    y = (k-x*a)/b
    if not y.is_integer() or y > n:
        continue
    y = int(y)

    ans += (f[n] * rf[x] % p * rf[n-x] % p) * (f[n] * rf[y] % p * rf[n-y] % p) % p

print(ans%p)

### FIXED CODE ###

n, a, b, k = [int(i) for i in input().split()]
p = 998244353

def fact(n, p):
    n_ = 1
    yield n_
    for i in range(1, n+1):
         n_ = (n_*i) % p
         yield n_

def invfact(n, f, p):
    m = pow(f[n], p-2, p)
    yield m
    for i in range(n, 0, -1):
        m = m * i % p
        yield m

f = list(fact(n+1, p))
rf = list(invfact(n+1, f, p))
rf.reverse()
ans = 0

for x in range(n+1):
    y = (k-x*a)/b
    if not y.is_integer() or y > n or y < 0:
        continue
    y = int(y)

    ans += (f[n] * rf[x] % p * rf[n-x] % p) * (f[n] * rf[y] % p * rf[n-y] % p) % p

print(ans%p)
list_len = int(input())
input_list = map(int, input().split)
even_list_len = list_len
count = 0
 
while:
  even_list = filter(lambda num: num % 2 , input_list)
  even_list_len = len(even_list)
  if list_len != even_list_len:
    break
  count += 1
    
print(count)

### FIXED CODE ###

input_list_len = int(input())
input_list = map(int, input().split())
even_list = input_list
even_list_len = input_list_len
count = 0

while True:
    even_list = list(filter(lambda num: num % 2 == 0, even_list))
    even_list_len = len(even_list)
    if input_list_len != even_list_len:
        break
    even_list = map(lambda num: num / 2, even_list)
    count += 1

print(count)
from math import gcd
from math import sqrt


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    A, B = map(int, input().split())
    C = gcd(A, B)
    if (A == 1 or B == 1):
        print(1)
        exit(0)
    if (C == 1):
        print(1)
        exit(0)
    arr = factorization(C)
    # print(arr)
    print(len(arr) + 1)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from fractions import gcd
from math import sqrt


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    A, B = map(int, input().split())
    C = gcd(A, B)
    if (C == 1):
        print(1)
        exit(0)
    arr = factorization(C)
    # print(arr)
    print(len(arr) + 1)


if __name__ == "__main__":
    main()
N, K = map(int, input().split())
x = []
y = []
for i in input().split():
    n = int(i)
    if n < 0:
        x.append(-n)
    elif n == 0:
        K -= 1
    else:
        y.append(n)

x = x[::-1]

len_x = len(x)
len_y = len(y)
now = 10 ** 18

if len_x == 0:
    if len_y == 0:
        print(0)
    else:
        print(y[K-1])
elif len_y == 0:
    print(x[K-1])
else:
    for i in range(max(K - len_x, 0), K+1):
        if len_x < i:
            break
        print('x',i, K-i)
        if i == 0:
            now = min(x[K-1], now)
        elif i == K:
            now = min(y[K-1], now)
        else:
            now = min(min(x[i-1], y[K-i-1]) + x[i-1] + y[K-i-1], now)

    print(now)

### FIXED CODE ###

N, K = map(int, input().split())
x = []
y = []
for i in input().split():
    n = int(i)
    if n < 0:
        x.append(-n)
    elif n == 0:
        K -= 1
    else:
        y.append(n)

x = x[::-1]

len_x = len(x)
len_y = len(y)
now = 10 ** 18

if len_x == 0:
    if len_y == 0:
        print(0)
    else:
        print(y[K-1])
elif len_y == 0:
    print(x[K-1])
else:
    for i in range(K+1):
        if K - i > len_y:
            continue
        if len_x < i:
            break
        if i == 0:
            now = min(y[K-1], now)
        elif i == K:
            now = min(x[K-1], now)
        else:
            now = min(min(x[i-1], y[K-i-1]) + x[i-1] + y[K-i-1], now)

    print(now)
import numpy as np
import math
n, k = map(int,input().split())
a = list(map(int,input().split()))
start = [i for i,x in enumerate(a) if x == min(a)]
m = 10000000
for i in start:
    if math.ceil(i/(k-1))+math.ceil(((n-1)-i)/(k-1)) < m:
        m = math.ceil(i/(k-1))+math.ceil(((n-1)-i)/(k-1))
print(m)

### FIXED CODE ###

s = input()
print(s.count("+")-s.count("-"))
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or 2 or 4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

### FIXED CODE ###

a=list(map(int,input().split()))
print('{:.0f}'.format(a[0]*a[1]/2))
N, K = map(int, input().split())
L = list(map(int, input().split()))

L = sorted(L, reverse=True)

print(sum(L[:K]))


### FIXED CODE ###

N = input()

print('ABC'+N)
n = int(input())

print(n(n-1)//2)

### FIXED CODE ###

n = int(input())
print(int(n*(n-1)//2))
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  b=a[i]
  if a[b] = i:
    ans += 1
  else:
    i += 1
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  b=a[i]
  if a[b-1] == i+1:
    ans += 1
  else:
    i += 1
print(int(ans/2))
N = int(input())
S = input()


ini_w = 0
for i in range(len(S)):
    if S[i] == '.':
        ini_w = ini_w + 1
    else:
        break
    
if ini_w >= len(S)-1:
    print(0)
    exit()
    


last_b = 0

for i in range(len(S)):
    if S[len(S)-i-1] == '#':
        last_b = last_b + 1
    else:
        break

S = S[ini_w:len(S)-last_b]

if S == '':
    print(0)

all_w = len(S) - S.count(".")
all_b = len(S) - all_w

print(min(all_w,all_b))

### FIXED CODE ###

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

if C < B and A < C:
    print('Yes')
elif C < A and B < C:
    print('Yes')
else:
    print('No')
INF = 10 ** 20
MOD = 10 ** 9 + 7
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  heapq import heappop,heapify,heappush
from bisect import bisect_left
from functools import reduce
from math import gcd

def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))

    if k > max(a):
        print('IMPOSSIBLE')
        return

    G = reduce(gcd,a)
    if k%G == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBEL')
if __name__ == '__main__':
    main()


### FIXED CODE ###

INF = 10 ** 20
MOD = 10 ** 9 + 7
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  heapq import heappop,heapify,heappush
from bisect import bisect_left
from functools import reduce
from fractions import gcd

def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))

    if k > max(a):
        print('IMPOSSIBLE')
        return

    G = reduce(gcd,a)
    if k%G == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
if __name__ == '__main__':
    main()
def gcd(x,y):
  if x>y: x,y = y,x
  while x:
    x,y = y%x, x
  return y

def lcm(a,b):
    return int(a*b /gcd(a,b))

n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
t.sort()
if(n==1):
    print(t[0])
    exit()
ans=lcm(t[0],t[1])
if(n==2):
    print(ans)
    exit()
for i in range(2,n):
    ans=lcm(ans,t[i])
print(ans)



### FIXED CODE ###

def gcd(x,y):
  if x>y: x,y = y,x
  while x:
    x,y = y%x, x
  return y

def lcm(a,b):
    return a*b //gcd(a,b)

n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))
t.sort()
if(n==1):
    print(t[0])
    exit()
ans=lcm(t[0],t[1])
if(n==2):
    print(ans)
    exit()
for i in range(2,n):
    ans=lcm(ans,t[i])
print(ans)
O,E = map(lambda x: [x2 for x2 in x],input().split())
if len(O) - len(E) == 1:
  E.append("")
print("".join([o+e for o,e in zip(O,E)]))

### FIXED CODE ###

from sys import stdin
O,E = map(lambda x: [x2 for x2 in x],stdin.read().splitlines())
if len(O) - len(E) == 1:
  E.append("")
print("".join([o+e for o,e in zip(O,E)]))
from collections import deque
N, M, K = map(int, input().split())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

def doku(li, K, time):
  cnt = 0
  for i in range(len(li)):
    if time+li[0] <= K:
      time += li[0]
      li.popleft()
      cnt += 1
    else:
      return cnt
  return cnt

ans = 0
time = 0
while time+min(A[0], B[0]) <= K:
  plus = min(A[0], B[0])
  time += plus
  ans += 1
  if A[0] == B[0]:
    if A[1] < B[1]:
      A.popleft()
      if not A:
        ans += doku(B, K, time)
        break;
    else:
      B.popleft()
      if not B:
        ans += doku(A, K, time)
        break;
  elif A[0] < B[0]:
    A.popleft()
    if not A:
      ans += doku(B, K, time)
      break;
  else:
    B.popleft()
    if not B:
      ans += doku(A, K, time)
      break;
    
print(ans)

### FIXED CODE ###

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

a = [0]
b = [0]
for i in range(N):
  a.append(A[i] + a[i])
for i in range(M):
  b.append(B[i] + b[i])
  
ans = 0
j = M
for i in range(N+1):
  if a[i] > K:
    break;
  while b[j] > K-a[i]:
    j -= 1
  ans = max(ans, i+j)
  
print(ans)
while True:
	a,b=sort(map(int(input().split())))
	break if a==0 and b==0
	print(a,b)


### FIXED CODE ###

while True:
	a,b=map(int,input().split())
	if (a==0) and (b==0):
		break
	if a > b :
		a,b = b,a
	print(a,b)
import sys
from collections import deque

def main():
  input = sys.stdin.readline
  n, m = map(int, input().split())
  roads0 = [[] for _ in range(n)]
  roads1 = [[] for _ in range(n)]
  roads2 = [[] for _ in range(n)]
  
  for i in range(m):
    u, v = map(int, input().split())
    roads0[u-1].append(v-1)
    roads1[u-1].append(v-1)
    roads2[u-1].append(v-1)
    
  ans = 100000000
  
  s, t = map(int, input().split())
  not_yet = deque([])
  already = [[False]*3 for _ in range(n)]
  dist = [[0]*3 for _ in range(n)]
  for v in roads0[s-1]:
    not_yet.append((v, 1))
    dist[v][1] = 1
    already[v][1] = True
  already[s-1][0] = True
  while not_yet:
    key = not_yet.pop()
    k1, k2 = key[0], key[1]
    if k2 == 0:
      for v in roads1[k2]:
        if already[v][1]:
          continue
        dist[v][1] = dist[k1][0]+1
        already[v][1] = True
        not_yet.append((v, 1))
    elif k2 == 1:
      for v in roads2[k2]:
        if already[v][2]:
          continue
        dist[v][2] = dist[k1][1]+1
        already[v][2] = True
        not_yet.append((v, 2))
    else:
      for v in roads3[k2]:
        if already[v][0]:
          continue
        dist[v][0] = dist[k1][2]+1
        already[v][0] = True
        not_yet.append((v, 0))
  if already[t-1][0]:
    print(dist[t-1][0])
  else:
    print(-1)

    
if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
from collections import deque

def main():
  input = sys.stdin.readline
  n, m = map(int, input().split())
  roads0 = [[] for _ in range(n)]
  roads1 = [[] for _ in range(n)]
  roads2 = [[] for _ in range(n)]
  
  for i in range(m):
    u, v = map(int, input().split())
    roads0[u-1].append(v-1)
    roads1[u-1].append(v-1)
    roads2[u-1].append(v-1)
  

  s, t = map(int, input().split())
  not_yet = deque([])
  already = [[False]*3 for _ in range(n)]
  dist = [[0]*3 for _ in range(n)]
  for v in roads0[s-1]:
    not_yet.append((v, 1))
    dist[v][1] = 1
    already[v][1] = True
  already[s-1][0] = True
  while not_yet:
    key = not_yet.popleft()
    k1, k2 = key[0], key[1]
    if k2 == 0:
      for v in roads1[k1]:
        if already[v][1]:
          continue
        dist[v][1] = dist[k1][0]+1
        already[v][1] = True
        not_yet.append((v, 1))
    elif k2 == 1:
      for v in roads2[k1]:
        if already[v][2]:
          continue
        dist[v][2] = dist[k1][1]+1
        already[v][2] = True
        not_yet.append((v, 2))
    else:
      for v in roads0[k1]:
        if already[v][0]:
          continue
        dist[v][0] = dist[k1][2]+1
        already[v][0] = True
        not_yet.append((v, 0))
  if already[t-1][0]:
    print(dist[t-1][0]//3)
  else:
    print(-1)
  
    
if __name__ == "__main__":
  main()
import math
import sys
input = sys.stdin.readline
A, B = map(int, input().split())

gcdv = math.gcd(A, B)

def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

ans = len(fac(gcdv))
if ans == 1:
    print(1)
else:
    print(ans+1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
A, B = map(int, input().split())

def gcd(a, b):
    if b==0:
        return a
    else:
        return gcd(b, a%b)

def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

gcdv = gcd(A, B)
l = fac(gcdv)
ans = len(l)

if ans == 1:
    if l[0][0] == 1:
        print(1)
    else:
        print(ans+1)
else:
    print(ans+1)
import sys

if __name__ == '__main__':
    r = int(sys.stdin.read())
    pi = 3.14159265359
    print "%.5f %.5f" % (pi * r * r, 2 * pi * r)


### FIXED CODE ###

import sys

if __name__ == '__main__':
    r = float(sys.stdin.read())
    pi = 3.14159265359
    print "%.5f %.5f" % (pi * r * r, 2 * pi * r)
x = int(input())
if x[0]==x[2]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

x = input()
if x[0]==x[2]:
  print("Yes")
else:
  print("No")
import math
N=int(input())
A=list(map(int,input().split()))
A.append(A[0])
ans=0
for i in range(N):
    val=math.gcd(A[i],A[i+1])
    ans=max(ans,val)
print(ans)

### FIXED CODE ###

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

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

L=[0 for _ in range(N+1)]
L[0]=0
for i in range(N):
    L[i+1]=gcd(L[i],A[i])

R=[0 for i in range(N+1)]
R[N-1]=A[N-1]
for i in range(1,N)[::-1]:
    R[i-1]=gcd(R[i],A[i-1])

ans=0
for i in range(N):
    ans=max(ans,gcd(L[i],R[i+1]))
print(ans)
import sys


class Graph:
    def __init__(self, nodes={}):
        self.nodes = nodes


n = int(input())
G = Graph()
for line in sys.stdin:
    numList = line.split()
    G.nodes[int(numList[0])] = list(map(int, numList[1:]))

for node in range(n):
    out = ''
    for adj in range(n):
        if adj + 1 != n:
            out += '1 ' if adj + 1 in G.nodes[node] else '0 '
        else:
            out += '1' if adj + 1 in G.nodes[node] else '0'
    print(out)

### FIXED CODE ###

import sys


class Graph:
    def __init__(self, nodes={}):
        self.nodes = nodes


n = int(input())
G = Graph()
for line in sys.stdin:
    numList = list(map(int, line.split()))
    G.nodes[numList[0]] = list(numList[2:])
for node in range(n):
    out = ''
    for adj in range(n):
        if adj + 1 != n:
            out += '1 ' if adj + 1 in G.nodes[node + 1] else '0 '
        else:
            out += '1' if adj + 1 in G.nodes[node + 1] else '0'
    print(out)
a,b = map(int,input())
print(-int((-a-b)//2)

### FIXED CODE ###

a,b = map(int,input().split())
print(-int((-a-b)//2))
import itertools
L,R=map(int,input().split())
ans=2019
for c in itertools.combinations(range(L,R+1),2):
	if (c[0]*c[1])%2019==0:
		print(0)
		exit()
	else:
		ans=min(ans,(c[0]*c[1])%2019)
print(ans)

### FIXED CODE ###

L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)