Harryxun/stf_run huggingface dataset:
# ABC047D

import sys# ABC047D

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))


n,t = map(int, input().split())
a = list(map(int, input().split()))

M = -1
m = 10**10
best = 0
count = 0
for num in a[::-1]:
    if M<num:
        M = num
        m = M
    elif num<m:
        m = num
    if best<(M-m):
        best = M - m
        count = 1
    elif best==(M-m):
        count += 1
#     print(M, m, count, best)
print(count) if t%2==0 else print(1)
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))


n,t = map(int, input().split())
a = list(map(int, input().split()))

M = -1
m = 10**10
best = 0
count = 0
for num in a[::-1]:
    if M<num:
        M = num
        m = M
    elif num<m:
        m = num
    if best<(M-m):
        best = M - m
        count = 1
    elif best==(M-m):
        count += 1
#     print(M, m, count, best)
print(count)

### FIXED CODE ###

# ABC047D

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))


n,t = map(int, input().split())
a = list(map(int, input().split()))

m = a[0]
best = 0
count = 0
for num in a[1:]:
    if m>num:
        m = num
    elif best<num-m:
        best = num - m
        count = 1
    elif best==num-m:
        count += 1
print(count)
days = ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = input()
if days.get(S) == 0:
  print(7)
else:
  print(days.get(S))
    

### FIXED CODE ###

days = ['SUN','MON','TUE','WED','THU','FRI','SAT']
S = input()
print(7-days.index(S))
n,d = mat(int,input().split())

if n % (d*2+1) != 0:
  print(int(n % (d*2+1) + 1)) 
 else:
  print(int(n % (d*2+1)))

### FIXED CODE ###

n,d = map(int,input().split())
 
if n % (d*2+1) != 0:
  print(int(n // (d*2+1) + 1)) 
else:
  print(int(n // (d*2+1)))
import sys
input=sys.stdin.readline
import math

n=int(input())
s=list(input())
ls=[0 if i=='W' else 1 for i in s]
a=sum(ls)
#print(a)
l=[math.inf]
for i in range(n):
    if ls[i]==1:
        a-=1
        l.append(a)
    elif ls[i]==0:
        a+=1
        l.append(a-1)
print(min(l))


### FIXED CODE ###

N=int(input())
S=input()
 
count=S[1:].count("E")
mincount=count
 
for i in range(1,N):
    if S[i]=="E":
        count-=1
    if S[i-1]=="W":
        count+=1
 
 
    mincount=min(count,mincount)
print(mincount)
N, K = map(int, input().split())
h = [(int(input()) for _ in range(N))]
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)


### FIXED CODE ###

N, K = map(int, input().split())
h = sorted(list(int(input()) for _ in range(N)))
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)
import math
import numpy as np
n=int(input())
a=[int(i) for i in input().split()]
a=list(set(a))
n=len(a)

ans=0
if n<3: print(max(a))
else:
    for i in range(n):
        b=np.array([x for x in a if not x==a[i]])
        while len(b)>1:
            d=math.gcd(b[0],b[1])
            b=np.delete(b,0)
            b[0]=d
        c=b[0]
        if ans<c: ans=c
    print(ans) 

### FIXED CODE ###

#c
n=int(input())
a=[int(i) for i in input().split()]
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
l=[1]*n
r=[1]*n
l[0]=a[0]
r[0]=a[n-1]
for i in range(1,n):
    l[i] = gcd(l[i-1],a[i])
    r[i] = gcd(r[i-1],a[n-i-1])
if n>=3:
    ans = max(l[-2],r[-2],max(gcd(l[i-1],r[n-i-2]) for i in range(1,n-1)))
    print(ans)
else:
    print(max(a))
H,W=map(int,input().split())
sq=[list(input()) for i in range(H)]
ans=False
c=H*W
pos=[[0,0,0]]

while ans==False:
    y,x,depth=pos.pop(0)

    if x==W-1 and y==H-1:
        ans=True

    if 0<=x+1<=W-1:
        if sq[y][x+1]==".":
            pos.append([y,x+1,depth+1])
            sq[y][x+1]="!"
            
    if 0<=x-1<=W-1:
        if sq[y][x-1]==".":
            pos.append([y,x-1,depth+1])
            sq[y][x-1]="!"
            
    if 0<=y+1<=H-1:
        if sq[y+1][x]==".":
            pos.append([y+1,x,depth+1])
            sq[y+1][x]="!"
            
    if 0<=y-1<=H-1:
        if sq[y-1][x]==".":
            pos.append([y-1,x,depth+1])
            sq[y-1][x]="!"
    
    
for j in range(H):
    for k in range(W):
        if sq[j][k]=="#":
            c-=1

print(c-depth-1)


### FIXED CODE ###

H,W=map(int,input().split())
sq=[list(input()) for i in range(H)]
ans=False
c=H*W
pos=[[0,0,0]]

while pos!=[]:
    y,x,depth=pos.pop(0)

    if x==W-1 and y==H-1:
        ans=True
        break

    if 0<=x+1<=W-1:
        if sq[y][x+1]==".":
            pos.append([y,x+1,depth+1])
            sq[y][x+1]="!"
            
    if 0<=x-1<=W-1:
        if sq[y][x-1]==".":
            pos.append([y,x-1,depth+1])
            sq[y][x-1]="!"
            
    if 0<=y+1<=H-1:
        if sq[y+1][x]==".":
            pos.append([y+1,x,depth+1])
            sq[y+1][x]="!"
            
    if 0<=y-1<=H-1:
        if sq[y-1][x]==".":
            pos.append([y-1,x,depth+1])
            sq[y-1][x]="!"
    
    
for j in range(H):
    for k in range(W):
        if sq[j][k]=="#":
            c-=1

if ans==True:
    print(c-depth-1)
else:
    print(-1)
A=list(map(int,input().split())
print(A[0]*A[1])

### FIXED CODE ###

A=list(map(int,input().split()))
print(A[0]*A[1])
x = Input()

x = x*x*x

print(x)


### FIXED CODE ###

x = input()
print x**3
n=int(input())
ans=0
if n<10**8:
  if n%2==0:
    for i in range(1,n-1,2):
      sum3=0
      sum5=0
      sum7=0
      x=str(i)
      l=len(x)
      for j in range(l):
        if x[j]=='3':
          sum3 += 1
        elif x[j]=='5':
          sum5 += 1
        elif x[j]=='7':
          sum7 += 1
        if (sum3 + sum5 + sum7 == l) and (sum3>0) and(sum5>0) and (sum7>0):
          ans+=1
  else:
    for i in range(1,n,2):
      sum3=0
      sum5=0
      sum7=0
      x=str(i)
      l=len(x)
      for j in range(l):
        if x[j]=='3':
          sum3 += 1
        elif x[j]=='5':
          sum5 += 1
        elif x[j]=='7':
          sum7 += 1
        if (sum3+sum5+sum7==l) and (sum3>0) and(sum5>0) and (sum7>0):
          ans+=1
print(ans)
else:
print(0)


### FIXED CODE ###

n=int(input())
def dfs(s):
  if int(s) > n:
    return 0
  if all(s.count(c) > 0 for c in '753'):
    ret=1
  else:
    ret=0 # s 自体が七五三数なら +1 
  for c in '753':
    ret += dfs(s + c)
  return ret
print(dfs('0'))
from collections import deque
X,Y,A,B,C = (int(i) for i in input().split())

P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
R = [int(i) for i in input().split()]
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)
P_deque = deque(P)
Q_deque = deque(Q)
R_deque = deque(R)

red_counter = 0
green_counter = 0

ans = 0

for i in range(X+Y):
  if red_counter == X:
    P_deque = [-1]
  elif green_counter == Y:
    Q_deque = [-1]

  if len(R) != 0:
    if P_deque[0] >= Q_deque[0] and P_deque[0] >= R_deque[0]:
      ans += P_deque.popleft()
      red_counter += 1
    elif Q_deque[0] >= P_deque[0] and Q_deque[0] >= R_deque[0]:
      ans += Q_deque.popleft()
      green_counter +=1
    else:
      ans += R_deque.popleft()
  else:
    if P_deque[0] >= Q_deque[0]:
      ans += P_deque.popleft()
      red_counter += 1
    elif Q_deque[0] >= P_deque[0]:
      ans += Q_deque.popleft()
      green_counter +=1

print(ans)


### FIXED CODE ###

from collections import deque
X,Y,A,B,C = (int(i) for i in input().split())

P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
R = [int(i) for i in input().split()]
P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)
P_deque = deque(P)
Q_deque = deque(Q)
R_deque = deque(R)

red_counter = 0
green_counter = 0

ans = 0

for i in range(X+Y):
  if red_counter == X:
    P_deque = [-1]
  elif green_counter == Y:
    Q_deque = [-1]

  if len(R_deque) != 0:
    if P_deque[0] >= Q_deque[0] and P_deque[0] >= R_deque[0]:
      ans += P_deque.popleft()
      red_counter += 1
    elif Q_deque[0] >= P_deque[0] and Q_deque[0] >= R_deque[0]:
      ans += Q_deque.popleft()
      green_counter +=1
    else:
      ans += R_deque.popleft()
  else:
    if P_deque[0] >= Q_deque[0]:
      ans += P_deque.popleft()
      red_counter += 1
    elif Q_deque[0] >= P_deque[0]:
      ans += Q_deque.popleft()
      green_counter +=1

print(ans)
# -*- coding:utf-8 -*-
import sys
sys.setrecursionlimit(100000)

def preDatasets(q):
	line = input()
	print(line)
	datas[q] = line
	return datas

def dfs(x, y, sym):
	tile[x][y] = '.'
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			if not tile[i][j] == '.':
				if tile[i][j] == '@':
					dfs(i, j, '@')
					res += 1
				elif tile[i][j] == '#':
					dfs(i, j, '#')
					res += 1
				elif tile[i][j] == '*':
					dfs(i, j, '*')
					res += 1
	print(res)

index = 0	
counter=0
datas = [[0 for i in range(1)]for j in range(1)] 
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
while True:
	line = input()
	
	if ' ' in line:
		N = int(datas[index].split(' ')[0])
		M = int(datas[index].split(' ')[1])
		tile = [[0 for i in range(N)]for j in range(M)]

	if N == 0:
		break

	if not counter<=M:
		for i in range(len(tile)):
			tile[i] = list(datas[index+i+1])
		solve()
		index += N+1

	counter+=1

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
x,y,z = map(int,input().split())
n = (y if x < y else x) 
array = []
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
print(array[z-1])


### FIXED CODE ###

x,y,z = map(int,input().split())
n = (y if x < y else x) 
n += 1
array = [1]
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])
#solve function
def solve(dates):
    counter = 0;
    start_month = dates[1]
    start_day, end_day = dates[2], 0

    for year in range(dates[0], 1000):
        for month in range(start_month, 11):
            if year%3 == 0 or month%2 == 1:
                end_day = 21
            else:
                end_day = 20

            # count days
            counter += (end_day - start_day)

            start_day = 1
        else:
            start_month = 1

    return counter


#main function
if __name__ == '__main__':
    n = int(input())

    dates = []
    tmp_dates = []
    for i in range(n):
        tmp_dates = input().split()
        for j in range(len(tmp_dates)):
            dates.append(int(tmp_dates[j]))

        date_count = solve(dates)
        print(date_count)

        dates.clear()

### FIXED CODE ###

#solve function
def solve(dates):
    counter = 0;
    start_month = dates[1]
    start_day, end_day = dates[2], 0

    for year in range(dates[0], 1000):
        for month in range(start_month, 11):
            if year%3 == 0 or month%2 == 1:
                end_day = 21
            else:
                end_day = 20

            # count days
            counter += (end_day - start_day)

            start_day = 1
        else:
            start_month = 1

    return counter


#main function
if __name__ == '__main__':
    n = int(input())

    dates = [0 for i in range(3)]
    tmp_dates = []
    for i in range(n):
        tmp_dates = input().split()
        for j, tmp_date in enumerate(tmp_dates):
            dates[j] = int(tmp_date)

        date_count = solve(dates)
        print(date_count)
import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N = ri()
XY = []
for i in range(N):
    x,y=rl()
    XY.append((x,y))
XY.sort()
XYD = []
for i in range(N):
    x,y = XY[i]
    ret = []
    for j in range(i+1,N):
        ret.append((XY[j][0] - x, XY[j][1] - y))
    XYD.extend(ret)

import collections
c = collections.Counter(XYD).most_common()
print(N-c[0][1])


### FIXED CODE ###

import sys
input = sys.stdin.readline
ri = lambda: int(input())
#rl = lambda: [int(x) if x.isdecimal() else x for x in input().split()]
#rl = lambda: list(input().split()))
rl = lambda: map(int,input().split())
rr = lambda N: [list(l) for l in zip(*[rl() for _ in range(N)])]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18
MOD = 10**9+7

N = ri()
XY = []
for i in range(N):
    x,y=rl()
    XY.append((x,y))
XY.sort()
XYD = []
for i in range(N):
    x,y = XY[i]
    ret = []
    for j in range(i+1,N):
        ret.append((XY[j][0] - x, XY[j][1] - y))
    XYD.extend(ret)

import collections
c = collections.Counter(XYD).most_common()
if N == 1:
    print(1)
else:
    print(N-c[0][1])
a,b = map(input().split())
x = a+b
print('error' if x >= 10 else x)

### FIXED CODE ###

a,b = map(int,input().split())
x = a+b
print('error' if x >= 10 else x)
import sys
print(1 + min(sys.argv[0] + sys.argv[1], sys.argv[2] - 1) + sys.argv[1])

### FIXED CODE ###

import sys
a, b, c = (int(i) for i in input().split())  
print(1 + min(a + b, c - 1) + b)
N = int(input())
A = list(map(int, input().split))

count = 0
while True:
  for i in range(len(A)):
    if A[i]%2==0:
      A[i] = A[i]/2
    count += 1  
    else:
      brake

### FIXED CODE ###

def how_many(n):
  count = 0
  while n%2==0:
    n = n/2
    count += 1
  return count

N = int(input())
A = map(int, input().split())
print(min(map(how_many, A)))
import bisect
 
N=int(input())
L=list(map(int,input().split()))
 
L.sort()
for i in range(0,N):
  for j in range(i+1,N):
    index=bisect.bisect_left(L,L[i]+L[j])
    count+=index-j-i
print(count)

### FIXED CODE ###

import bisect
 
N=int(input())
L=list(map(int,input().split()))
 
L.sort()
count=0
for i in range(N):
  for j in range(i+1,N):
    c=L[i]+L[j]
    index=bisect.bisect_left(L,c)
    count+=max(0,index-j-1)
print(count)
import math
n,k = map(int,input().split())


print( 0 if k == 1 else math.gcd(n,k))

### FIXED CODE ###

from fractions import gcd
n,k = map(int,input().split())

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

	for i in range(100000):
		a = min(a,abs(a-b))
	return a
if n == 0:
	print(0)
elif n ==1:
	if k == 1:
		print(0)
	else:
		print(1)
elif k == 1:
	print(0)
else:
	print(process(n,k))
int x=input()
n=[]
for i in range(x):
  n[i] = input()

def cal(n):
  int count=0
  for i in range(len(a)):
    if (n[i]%2==0) and ((n[i]%3==0)and(n[i]%5==0)):
      count+=1
  if count == len(n):
    print("APPROVED")
  else:
    print("DENIED")

cal(n)

### FIXED CODE ###

x = int(input())

n = [int(e) for e in input().split()]

def cal(n):
    count = 0
    for i in range(len(n)):
        if n[i] % 2 == 0:
            if n[i] % 3 == 0 or n[i] % 5 == 0:
                count += 1
        else:
            count += 1
    if count == len(n):
        print("APPROVED")
    else:
        print("DENIED")
cal(n)
K, S = map(int, input().split())
wariate = 0

for x in range(0, K + 1):
    if S - x <= K:
        wariate += max(S - x + 1, 0)
    else:
        wariate += max(0, 2 * K - (S - x) + 1)

print(wariate)

### FIXED CODE ###


s = input().split(",")

print(*s)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def popcnt(n):
    return bin(n).count("1")


def mod(n, cnt):
    if n == 0:
        return cnt
    n = n % popcnt(n)
    cnt += 1
    return mod(n, cnt)


n = int(readline())
x2 = list(readline().decode().rstrip())
x10 = int(''.join(x2), 2)

c = x2.count('1')
mod1 = x10 % (c + 1)
mod2 = x10 % (c - 1) if c - 1 != 0 else 0

for i in range(n):
    if x2[i] == '0':
        t = (mod1 + pow(2, n - i - 1, c + 1)) % (c + 1)
    else:
        if c - 1 != 0:
            t = (mod2 - pow(2, n - i - 1, c - 1)) % (c - 1)
        else:
            print(0)
            continue
    print(mod(t, 1))

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

l, r, d = map(int, readline().split())

if l % d == 0:
    ans = r // d - l // d + 1
else:
    ans = r // d - l // d
print(ans)
# ABC094D - Binomial Coefficients (ARC095D)
from bisect import bisect_left as bs


def main():
    # pascal's triangle := mid area (nCn/2) is the biggest -> bisect
    N = int(input())
    A = sorted(map(int, input().split()))
    if N == 2:
        print(A[1], A[0])
        return
    n, idx = A[-1], bs(A[:-1], A[-1] // 2)
    cand = [abs(A[i] - n / 2), A[i] for i in (idx - 1, idx, idx + 1)]
    r = min(cand)[1]
    print(n, r)


if __name__ == "__main__":
    main()

### FIXED CODE ###

# ABC094D - Binomial Coefficients (ARC095D)
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    n = max(A)
    r = A[0] if A[0] != n else A[1]
    cur = r * (n - r)
    for i in A:
        if i != n:
            x = i * (n - i)
            if x > cur:
                r, cur = i, x
    print(n, r)


if __name__ == "__main__":
    main()
import sys
#from collections import defaultdict, deque, Counter
#from bisect import bisect_left
#import heapq
#import math
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

#n = int(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split()))
L,R = map(int, stdin.readline().rstrip().split())
#S = [list(stdin.buffer.readline().decode().rstrip()) for _ in range(h)]

lsho, lmod = divmod(L,2019)
rsho, rmod = divmod(R,2019)

if rsho - lsho == 0:
    print(int((lmod*(lmod+1))%2019))
    exit()

u = [0]*2019
for l in range(lsho,2019):
    u[l] += 1
for r in range(rsho):
    u[r] += 1

for i,v in enumerate(u):
    if v == 0:
        pass
    if v == 1:
        if u[i+1] != 0:
            print(int((i*(i+1))%2019))
            exit()
        else:
            for j in range(i+1,2019):
                if u[j] == 1:
                    print(int((i*j%2019)))
                    exit()
    if v == 2:
        print(int((i*i)%2019))
        exit()


### FIXED CODE ###

import sys
#from collections import defaultdict, deque, Counter
#from bisect import bisect_left
#import heapq
#import math
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

#n = int(stdin.readline().rstrip())
#l = list(map(int, stdin.readline().rstrip().split()))
L,R = map(int, stdin.readline().rstrip().split())
#S = [list(stdin.buffer.readline().decode().rstrip()) for _ in range(h)]

if R-L > 2019:
    print(0)
    exit()

ans = 2018
for i in range(L,R):
    for j in range(L+1,R+1):
        ans = min(ans, (i*j)%2019)

print(ans)
A = int(input())
B = int(input())
C = int(input())
print(max(0,B+C-A))

### FIXED CODE ###

A,B,C =  map(int,input().split())
print(max(0,B+C-A))
M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2 == 1:
    print 1
else:
    print 0


### FIXED CODE ###

M1, D1 = map(int, input().split())
M2, D2 = map(int, input().split())

if D2 == 1:
    print(1)
else:
    print(0)
s=str(input())
p=list('ABDEGHIJKLMNOPQRSTUVWXYZ')
p.remove("C")
p.remove("F")
for i in p:
    s=s.replace(i,'')
 
if 'CF' in s:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=str(input())
p=[chr(i) for i in range(65, 65+26)]
p.remove("C")
p.remove("F")
for i in p:
    s=s.replace(i,'')
 
if 'CF' in s:
    print('Yes')
else:
    print('No')
a = int(input())
b = map(int, input().split())

cnt = 0
endflag = False

while(True):
  for i in range(0,len(b)-1):
    if ((b[i] % 2 ) == 0):
      b[i] = b[i] /2
    else:
      endflag = true
  cnt = cnt +1  
  if (endflag == True):
    break
      
print(cnt)


### FIXED CODE ###

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

cnt = 0
endflag = False

while(True):
  for i in range(0,a):
    if ((b[i] %2 ) == 0):
      b[i] = b[i] / 2
    else:
      endflag = True
      break
  if (endflag):
    break
  cnt = cnt + 1

print(cnt)
import itertools

nums = [int(e) for e in input().split()]

list0 = []
for i in range(0, nums[0]):
    val = [int(e) for e in input().split()]
    list0.append(val)

A = []
A0 = list(range(0,nums[0]))
for x in itertools.combinations_with_replacement(A0,nums[0]):
    A1 = list(x)
    A1 = list(set(A1))
    A.append(A1)

X = []
for i in range(0,len(A)):
    Y = [0] * (nums[1]+1)
    for j in range(0,len(A[i])):
        Y = [x + y for (x, y) in zip(Y,list0[A[i][j]])]
    X.append(Y)

B = []
for i in range(0,len(X)):
    if X[i][1] >= nums[2] and X[i][2] >= nums[2] and X[i][3] >= nums[2]:
        B.append(X[i][0])

if len(B) == 0:
    print('-1')
else:
    print(min(B))

### FIXED CODE ###

import itertools

nums = [int(e) for e in input().split()]

list0 = []
A = []
A0 = list(range(0,nums[0]))
for i in range(0, nums[0]):
    val = [int(e) for e in input().split()]
    list0.append(val)
    for x in itertools.combinations(A0,i+1):
        A.append(list(x))

Z = [0]
for i in range(1,nums[1]+1):
    Z.append(nums[2])

X = []
for i in range(0,len(A)):
    Y = [0] * (nums[1]+1)
    for j in range(0,len(A[i])):
        Y = [x + y for (x, y) in zip(Y,list0[A[i][j]])]
    W = [x - y for (x, y) in zip(Y,Z)]
    if min(W) >= 0:
        X.append(Y[0])

if len(X) > 0:
    print(min(X))
else:
    print('-1')
n=int(input())
a=0
k=n//15
a+=60*k**2
While 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=0
print(a)

### FIXED CODE ###

n=int(input())
a=0
k=n//15
a+=60*k**2
while not 0==n%15:
  if not n%3==0 and not n%5==0:
    a+=n
  n-=1
print(a)
from math import ceil,floor
from math import gcd

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

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

ans = B-A+1
ans -= B//C - ceil(A/C) + 1
ans -= B//D - ceil(A/D) + 1
ans += B//lcm(C,D) - ceil(A/lcm(C,D)) + 1

print(ans)

### FIXED CODE ###

from math import ceil,floor
from fractions import gcd

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

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

ans = B-A+1
ans -= B//C - (A-1)//C
ans -= B//D - (A-1)//D
ans += B//lcm(C,D) - (A-1)//lcm(C,D)

print(ans)
n,a=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
y=[i-a for i in x]
m=sum(x)+1
dp=[[0 for j in range(m*2+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for j in range(-m,1+m):
        if j-y[i-1]>=-m:
            dp[i][j]=dp[i-1][j]+dp[i-1][j-y[i-1]]
        else:
            dp[i][j]=dp[i-1][j]

print(dp[n][0]-1)


### FIXED CODE ###

n,a=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
y=[i-a for i in x]
m=sum(x)+1
dp=[[0 for j in range(m*2+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for j in range(-m,1+m):
        if j-y[i-1]>=-m and j-y[i-1]<=1+m:
            dp[i][j]=dp[i-1][j]+dp[i-1][j-y[i-1]]
        else:
            dp[i][j]=dp[i-1][j]

print(dp[n][0]-1)
a,b=map(int,input().split())
if a//3==0 or b//3==0 (a+b)//3==0:
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
K = int(input())
A, B = map(int, input().split())

s = (B // K) * K
if B => A: #もし最大のKの倍数がA以上ならOK
    print("OK")
else:
    print("NG")

### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if i % k == 0:
    print("OK")
    break
else:
  print("NG")