Harryxun/stf_run huggingface dataset:
n = int(input())
lst=list(map(int,input().split()))

differences=[]
for i in range(1,n):
    if lst[i]-lst[i-1]==0:#0はリストに加えず,-1の連続の有無のみを調べる
        continue
    elif lst[i]-lst[i-1]<=-2:#階差数列に-2以下が出てくればアウト
        print("No")
        sys.exit()
    else:differences.append(lst[i]-lst[i-1])

    
for i in range(len(differences)-1):#-1の連続があればアウト
    if differences[i]==-1 and differences[i+1]==-1:
        print("No")
        sys.exit()
 
 
print("Yes")

### FIXED CODE ###

import sys
n = int(input())
lst=list(map(int,input().split()))
lst.append(10**9+1)

count = 0
for i in range(n):
 
    if lst[i+1]-lst[i]==-1:#1さがったとき
        if count==0:
            count=-1
            continue
        else:#count=-1
            print("No")
            sys.exit()
    elif lst[i]==lst[i+1]:#おなじとき
        continue
        
    elif lst[i]<lst[i+1]:#上がったとき
        count = 0
        continue
    
    else:#2以上下がったとき
        print("No")
        sys.exit()
        


print("Yes")
def prime_factorization(N):
    a = []
    while N%2 == 0:
        a.append(2)
        N//= 2
    f = 3
    while f*f <= N:
        if N%f == 0:
            a.append(f)
            N//= f
        else:
            f+= 2
    if N != 1:
        a.append(N)
    return(a)

N = int(input())

a = prime_factorization(N)
Length = len(a)
if Length%2 == 0:
    for i in range(Length-Length/2):
        x = a[Length/2]*a[Length/2+i]
else:
    for i in range(Length-int(Length/2)):
        x = a[int(Length/2)-1]*a[int(Length/2)+i-1]
y = N//x
print(x+y-2)

### FIXED CODE ###

N = int(input())
a = []
for i in range(1,int(N**0.5+1)):
    if N%i == 0:
        x = i+N//i
        a.append(x)
print(min(a)-2)
k = int(input())
def gcd1 (a, b):
    while True:
        if (a < b):
            a, b = b, a
        c = a%b
        if (c == 0):
            return (b)
        else:
            a = b
            b = c

def gcd2 (a, b, c):
    tmp = gcd1(a, b)
    ans = gcd1(tmp, c)
    return (ans)

count = 0
for i in range(k):
    for j in range(i, k):
        for l in range(j, k):
            tmp = gcd(i + 1, j + 1, l + 1)
            if (i == J == l):
                count = count + tmp
            elif (i == j or j == l):
                count = count + tmp*3
            else:
                count = count + tmp*6
print(count)


### FIXED CODE ###

k = int(input())
def gcd1 (a, b):
    while True:
        if (a < b):
            a, b = b, a
        c = a%b
        if (c == 0):
            return (b)
        else:
            a = b
            b = c

count = 0
for i in range(k):
    for j in range(k):
        tmp = gcd1(i + 1, j + 1)
        if (tmp == 1):
            count = count + k
        else:
            for l in range(k):
                tmp2 = gcd1(tmp, l + 1)
                count = count + tmp2

print(count)
import sys
from collections import defaultdict
from heapq import heappush, heappop, heapify
input = sys.stdin.readline

INF = 10**12
n, m, s = map(int, input().split())
edges = defaultdict(lambda: defaultdict(lambda: [INF, INF]))
cd = []
max_a = 0

for i in range(m):
    u, v, a, b = map(int, input().split())
    max_a = max(max_a, a)
    edges[u-1][v-1] = [a, b]
    edges[v-1][u-1] = [a, b]

for i in range(n):
    c, d = map(int, input().split())
    cd.append([c, d])

# 解答ACする
# Dijakstraの状態を(頂点、所持している銀貨の枚数, cost)で持つ
# SIZE = max_a * n + 1
SIZE = 2550
if s > SIZE:
    s = SIZE
nodes = [[INF for _ in range(SIZE)] for _ in range(n)]
nodes[0][s-1] = 0

def dijakstra():
    goals = set({0})
    que = [(0, 0, s)]
    heapify(que)
    while len(que) > 0:
        # print(que[:3])
        cost, num, silver = heappop(que)
        if nodes[num][silver] < cost:
            continue
        # print(cost, num, silver)
        if num not in goals:
            goals.add(num)
        if len(goals) == n:
            break
        c, d = cd[num]
        for v in edges[num].keys():
            a, b = edges[num][v]
            times = -1
            to = silver - a
            while to < SIZE:
                times += 1
                plus = times * c
                to = silver + plus - a
                if to < 0:
                    continue
                if to >= SIZE:
                    break
                if nodes[v][to] > cost + b + d * times:
                    nodes[v][to] = cost + b + d * times
                    heappush(que, (cost + b + d * times, v, to))
dijakstra()
for i in range(1, n):
    print(min(nodes[i]))



### FIXED CODE ###

ic=lambda i,c:i+c*50
n,m,s=map(int,input().split())
edge=[[]for _ in range(125100)]
for _ in range(m):
  u,v,a,b=map(int,input().split())
  u-=1
  v-=1
  for i in range(a,2501):
    edge[ic(u,i)].append((ic(v,i-a),b))
    edge[ic(v,i)].append((ic(u,i-a),b))
for i in range(n):
  c,d=map(int,input().split())
  for j in range(c,2501):
    edge[ic(i,j-c)].append((ic(i,j),d))
from heapq import heappop,heappush
def dijkstra(s,n,edge):
  inf=10**20
  ans=[inf]*n
  ans[s]=0
  h=[[0,s]]
  while h:
    c,v=heappop(h)
    if ans[v]<c:continue
    for u,t in edge[v]:
      if c+t<ans[u]:
        ans[u]=c+t
        heappush(h,[c+t,u])
  return ans
d=dijkstra(ic(0,min(2500,s)),125100,edge)
ans=[0]+[10**20]*(n-1)
for i in range(1,n):
  for j in range(2501):ans[i]=min(ans[i],d[ic(i,j)])
print(*ans[1:])
H,W = map(int,input().split())
f = list(str(input()) for i in range(H))

for i in range(H):
  for j in range(W):
    if f[i][j] == "#":
      continue
    
    count = 0
    if i > 0 and j > 0:
      if f[i-1][j-1] == "#":
        count+=1
    if i > 0:
      if f[i-1][j] == "#":
        count+=1
    if i > 0 and j < W-1:
      if f[i-1][j+1] == "#":
        count+=1
    if j > 0:
      if f[i][j-1] == "#":
        count+=1
    if j < W-1:
      if f[i][j+1] == "#":
        count+=1
    if i < H-1 and j > 0:
      if f[i+1][j-1] == "#":
        count+=1
    if i < H-1:
      if f[i+1][j] == "#":
        count+=1
    if i < H-1 and j < W-1:
      if f[i+1][j+1] == "#":
        count+=1
    
    f[i][j] = str(count)
    
for i in range(H):
  print(f[i])
    

### FIXED CODE ###

H,W = map(int,input().split())
f = list(list(str(input())) for i in range(H))

for i in range(H):
  for j in range(W):
    if f[i][j] == "#":
      continue
    
    count = 0
    if i > 0 and j > 0:
      if f[i-1][j-1] == "#":
        count+=1
    if i > 0:
      if f[i-1][j] == "#":
        count+=1
    if i > 0 and j < W-1:
      if f[i-1][j+1] == "#":
        count+=1
    if j > 0:
      if f[i][j-1] == "#":
        count+=1
    if j < W-1:
      if f[i][j+1] == "#":
        count+=1
    if i < H-1 and j > 0:
      if f[i+1][j-1] == "#":
        count+=1
    if i < H-1:
      if f[i+1][j] == "#":
        count+=1
    if i < H-1 and j < W-1:
      if f[i+1][j+1] == "#":
        count+=1
    
    f[i][j] = str(count)

for i in range(H):
  n = ""
  for j in range(W):
    n+=f[i][j]
  print(n)
n = int(input())
ans = [0]*n
tmp = []

for x in range(1, int(n**0.5) +1):
    for y in range(1, int(n**0.5)+1):
        for z in range(1, int(n**0.5)+1):
            tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)

cnt = collections.Counter(tmp)

for i in range(1, n+1):
    print(cnt[i])
    


### FIXED CODE ###

import collections
import sys
input=sys.stdin.readline

n=int(input())
ans=[0]*n
tmp=[]
for x in range(1,int(n**0.5)+1): #可能なすべてのx,y,zについてx^2+y^2+z^2+xy+yz+zxの値を求める
   for y in range(1,int(n**0.5)+1):
       for z in range(1,int(n**0.5)+1):
           tmp.append(x**2+y**2+z**2+x*y+y*z+z*x)
cnt=collections.Counter(tmp) #x^2+y^2+z^2+xy+yz+zxの値の個数を数える
for i in range(1,n+1): #各iについて、x^2+y^2+z^2+xy+yz+zxの値がiであるものの個数が答えとなる
   print(cnt[i])
K = int(input())
A = list(map(int, input().split()))

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

class lazy_eval_list(list):
    def __init__(self, func, a):
        super().__init__(a)
        self._func = func
        
    def __getitem__(self, key):
        return self._func(super().__getitem__(key))

lazy_winner_count_N = lazy_eval_list(winner_count, range(sum(A)))

import bisect
_min = bisect.bisect_left(lazy_winner_count_N, 2)
_max = bisect.bisect_right(lazy_winner_count_N, 2) -1

if _min > _max:
    print(-1)
    exit()

print(_min, _max)

### FIXED CODE ###

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

def winner_count(N, A=A):
    for a in A:
        N = a*(N//a)
    return N

def bisect_left(func, l, r, target):
    # n>=i ⇒ func(n) <= targetを満たす最小のi
    # l=1, r=sum(A)+2
    # func(l)<= target, target<=func(r)
    if l==r:
        return 0
    if l+1==r:
        if func(l)< target:
            return r
        else:
            return l
    c = (l+r)//2
    if target <= func(c):
        return bisect_left(func, l, c, target)
    else:
        return bisect_left(func, c, r, target)

def bisect_right(func, l,r, target):
    if l==r:
        return 0
    if l+1==r:
        if target < func(r):
            return l
        else:
            return r
    c = (l+r)//2
    if target < func(c):
        return bisect_right(func, l, c, target)
    else:
        return bisect_right(func, c, r, target)

_min = bisect_left(winner_count, 1, sum(A)+2, 2)
_max = bisect_right(winner_count, 1, sum(A)+2, 2)


if _min > _max:
	print(-1)
else:
	print(_min, _max)
k = int(input())
x = 7%k
s = []

for i in range(k):
  if x == 0:
    print(len(s+1))
    exit()
  s.append(x)
  x = (10*x + 7)%k

  
  
print(-1)


### FIXED CODE ###

k = int(input())
x = 7%k
s = []

for i in range(k):
  if x == 0:
    print(i+1)
    exit()
  s.append(x)
  x = (10*x + 7)%k

  
  
print(-1)
list(a,b,c)=input().split()

print(max(c - (a-b), 0))

### FIXED CODE ###

l=list(map(int,input().split()))
a = l[0]
b = l[1]
c = l[2]


print(max(c - (a-b), 0))
n = int(input())

d = map(int,input().split())

s = 0

for i in range(n):
    for j in range(i,n):
        s += d[i] * d[j]
print(s)

### FIXED CODE ###

n = int(input())

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

s = 0

for i in range(n):
    for j in range(i+1,n):
        s += d[i] * d[j]
print(s)
h,w=map(int,input().split())
a=[input() for _ in range(h)]

res=[]
for i in range(h):
    if "#" not in a[i]:
      res.append(i)
for i in res:
  a.pop(i)
res=[]
h=len(a)
for i in range(w):
    for j in range(len(a)):
      if a[j][i]=="#":
        break
    else:
      res.append(j)
for i in res:
  for j in range(len(a)):
    a[j]=a[j][:i]+a[j][i+1:]
for i in a:
  print(*i)

### FIXED CODE ###

h,w=map(int,input().split())
a=[input() for _ in range(h)]
res=[]
for i in range(h):
    if "#" not in a[i]:
      res.append(i)

resh=[]
h=len(a)
for i in range(w):
    for j in range(len(a)):
      if a[j][i]=="#":
        break
    else:
      resh.append(i)
for i in range(h):
  for j in range(w):
    if i not in res and j not in resh:
      print(a[i][j],end="")
  if i not in res:
    print("")
N = int(input())
A = [int(i) for i in input().split()]

import math
import itertools

m = min(A)

for v in itertools.combinations(A,2):
    m1 = math.gcd(*v)
    if m > m1:
        m = m1
print(m)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

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

a = A[0]
for i in range(1,N):
    a = gcp(a,A[i])
print(a)
N, K, S = map(int,input())
L = [S]*K
for i in range(N-K):
  L.append(S+1)
  
print(' '.join(L))

### FIXED CODE ###

N, K, S = map(int,input().split())
L = [S]*K
for i in range(N-K):
  if S < 10**9:
  	L.append(S+1)
  else:
    L.append(1)
  
print(' '.join(map(str, L)))
S = input()
T = input()
if S == D[:len(S)]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()
T = input()
if (S == T[:len(S)]) and ((len(S)+1)==len(T)):
    print('Yes')
else:
    print('No')
x1,y1,x2,y2=map(int,input().split())
print("%.6f"%((x2-x1)**2+(y2-y1**2))**0.5)

### FIXED CODE ###

x1,y1,x2,y2=map(float,input().split())
print("%.6f"%((x2-x1)**2+(y2-y1)**2)**0.5)
mod =10**9 + 7
N=int(input())
a=10**N
b=a*((8/10)**N)
print(int(a-b)/mod)

### FIXED CODE ###

mod =10**9 + 7
N=int(input())
a=10**N
b=9**N
c=8**N
print((a-(2*b)+c)%mod)
N = int(input())
num = list(map(int,input().split()))
b= 1
for a in range(N):
  b = b * num[a]
  if b > 10**18:
    print(-1)
  else:
    print(b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
N, M = map(int, input().split())
A = list(map(int, input().split()))

costs = [2,5,5,4,5,6,3,7,6,1000]

def my_max(arr):
    _max = 0
    arg = -1
    for i,a in enumerate(arr):
        if _max < a:
            _max = a
            arg = i
    return arg, _max


def main():
    min_a = 10-1
    for a in A:
        if costs[a-1] < costs[min_a-1]:
            min_a = a
    rep = N//costs[min_a-1]
    res = N%costs[min_a-1]
    if res==0:
        print(str(min_a)*rep)
        return

    # two chars
    cands = []
    i = 1
    while costs[min_a-1]*i+res <= 7:
        for a in A:
            if (costs[min_a-1]*i+res) % costs[a-1] == 0:
                cands.append(a)
        if len(cands)>0:
            break
        i += 1
    if len(cands)>0:
        a = max(cands)
        rep = (N-costs[a-1]*i) // costs[min_a-1]
        if a>min_a:
            print(str(a)*i + str(min_a)*rep)
            return
        else:
            print(str(min_a)*rep + str(a)*d)
            return
    
    # three chars
    while costs[min_a-1]*i+res <= 14:
        for a0 in A:
            for a1 in A:
                if (costs[min_a-1]*i+res) % (costs[a0-1]+costs[a1-1]) == 0:
                    cands.append(a0*10+a1)
        if len(cands)>0:
            break
        i += 1
    if len(cands)>0:
        a = max(cands)
        a0 = a//10
        a1 = a%10
        rep = (N-i*(costs[a0-1]-costs[a1-1])) // costs[min_a-1]
        if min_a < a1:
            print(str(a0)*i + str(a1)*i + str(min_a)*rep)
        elif min_a < a0:
            print(str(a0)*i + str(min_a)*rep + str(a1)*i)
        else:
            print(str(min_a)*rep + str(a0)*i + str(a1)*i)
        return

main()

### FIXED CODE ###

costs = [2,5,5,4,5,6,3,7,6]

N, M = map(int, input().split())
A = list(map(int, input().split()))
neginf = -1 * 1e20
D = [neginf]*(N+1)

def dp(n_match):
    D[0] = 0
    for n in range(1,n_match+1):
        arr = [D[n-costs[a-1]] if n-costs[a-1]>=0 else neginf for a in A]
        D[n] = max(arr)+1

def main():
    dp(N)
    n = N
    ans = ''
    while n>1:
        arr = [ a for a in A if  n-costs[a-1]>=0 and D[n-costs[a-1]]==D[n]-1 ]
        if len(arr)>0:
            a = max(arr)
            ans += str(a)
            n -= costs[a-1]
        else:
            break
    print(ans)

main()
# Cross product
def cross(p1, p2, q1, q2):
    p = p2 - p1
    q = q2 - q1
    return p.real * q.imag - p.imag * q.real

# Rotating calipers
def convex_diameter(points, n):
    points.append(points[0])
    p0 = points[0]
    p1 = points[1]
    for i, (q1, q2) in enumerate(zip(points[1:], points[2:]), start=1):
        if cross(p0, p1, q1, q2) < 0:
            break
    
    max_d = abs(points[i] - points[0])

    points.append(points[1])
    side1 = zip(points[0:i+1], points[1:i+2])
    side2 = zip(points[i:n+1], points[i+1:])
    p1, p2 = side1.__next__()
    q1, q2 = side2.__next__()
    
    for i in range(n - 1):
        if cross(p1, p2, q1, q2) > 0:
            q1, q2 = side2.__next__()
        else:
            p1, p2 = side1.__next__()
        max_d = max(max_d, abs(p1 - q1))

    return max_d

# Acceptance of input
def string_to_complex(s):
    x, y = map(float, s.split())
    return x + y * 1j

import sys

file_input = sys.stdin

n = int(file_input.readline())

P = [string_to_complex(line) for line in file_input]

# Output
ans = convex_diameter(P, n)
print('{:f}'.format(ans))

### FIXED CODE ###

# Cross product
def cross(p1, p2, q1, q2):
    p = p2 - p1
    q = q2 - q1
    return p.real * q.imag - p.imag * q.real

# Rotating calipers
er = 1e-16

def convex_diameter(points, n):
    points.append(points[0])
    p0 = points[0]
    p1 = points[1]
    for i, (q1, q2) in enumerate(zip(points[1:], points[2:]), start=1):
        if cross(p0, p1, q1, q2) < -er:
            break
    
    max_d = abs(points[i] - points[0])

    points.append(points[1])
    side1 = zip(points[0:i+1], points[1:i+2])
    side2 = zip(points[i:n+1], points[i+1:])
    p1, p2 = side1.__next__()
    q1, q2 = side2.__next__()
    
    for i in range(n - 1):
        if cross(p1, p2, q1, q2) > er:
            q1, q2 = side2.__next__()
        else:
            p1, p2 = side1.__next__()
        max_d = max(max_d, abs(p1 - q1))

    return max_d

# Acceptance of input
def string_to_complex(s):
    x, y = map(float, s.split())
    return x + y * 1j

import sys

file_input = sys.stdin

n = int(file_input.readline())

P = [string_to_complex(line) for line in file_input]

# Output
ans = convex_diameter(P, n)
print('{:f}'.format(ans))
a, b = map(int, input().split()

ans = a * b
           
print(ans)

### FIXED CODE ###

# 169A

#1.入力をちゃんと受け取ること
#ex：｢2 5」⇒ a = 2,  b = 5　みたいにしないといけない。
a, b = map(int, input().split())
#print(a)
#print(b)

#2.目的通りの計算をする
#ex：２つの整数ＡとＢの掛け算をやる
answer = a * b

#3.計算の結果を出力する
print(answer)
(n, m) = [int(i) for i in input().split()]
A = []
b = []

for i in range(n):
    A.append([int(j) for j in input().split()])

for i in range(m):
    b.append(int(input()))

c = []
for i in range(n):
    m = 0 
    for j in range(m):
        s += A[i][j] = b[j]
    print(s)

### FIXED CODE ###

n,m = map(int,input().split())
rc = [list(map(int,input().split())) for i in range(n)]
vector = [int(input()) for i in range(m)]
[print(sum([j*k for j,k in zip(rc[i],vector)])) for i in range(n)]
N, Y = map(int, input())

for x in range(N+1):
    for y in range(N+1):
        z = N - (x + y)
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            print(x, y, z)
            break
    if flag:
        break

### FIXED CODE ###

N, Y = map(int, input().split())

flag = False
for x in range(N+1):
    for y in range(N-x+1):
        z = N - (x + y)
        if Y == 10000 * x + 5000 * y + 1000 * z:
            flag = True
            print(x, y, z)
            break
    if flag:
        break
else:
    print(-1, -1, -1)
a = 0
b = 0
c = 0
for i in range(0, 10):
  inputNum = int(raw_input())

  if a < inputNum:
    a = inputNum
    continue
  elif b < inputNum:
    b = inputNum
    continue
  elif c < inputNum:
    c = inputNum

print a
print b
print c

### FIXED CODE ###

inputNum = []

for i in range(0, 10):
  inputNum.append(int(raw_input()))

inputNum.sort(reverse=True)

for i in range(0, 3):
  print inputNum[i]
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
d=[0]*(n+1)
for i in l:
    d[i]+=1
ans=0
for i in d:
    ans+=i*(i-1)//2
for i in range(n):
    print(ans-d[l[i]]-1)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
d=[0]*(n+1)
for i in l:
    d[i]+=1
ans=0
for i in d:
    ans+=i*(i-1)//2
for i in range(n):
    print(ans-d[l[i]]+1)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n=int(input())
a=[]
for i in range(0,n):
  a.append(int(input()))
a.sort()

b = [a[0]]
a=a[1:]

f=True
while len(a)>0:
  la=len(a)-1
  lb=len(b)-1
  ln = abs(b[0]-a[0])
  lx = abs(b[0]-a[la])
  rn = abs(b[lb]-a[0])
  rx = abs(b[lb]-a[la])

  x = max(ln, max(lx, max(rn, rx)))
  
  if x == ln:
    b.insert(0,a[0])
    a=a[1:]
  elif x == lx:
    b.insert(0,a.pop())
  elif x == rn:
    b.append(a[0])
    a=a[1:]
  else:
    b.append(a.pop())

res=0
for i in range(0,len(b)-1):
  res=res+abs(b[i]-b[i+1])
print(res)


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
s=input()
if len(s)==2:
  print(s)
else:
  print(s[2]+s[1]+s[0])
N,M,A,B=map(int,input().split())
for m in range(M):
    if N<=A:
        N+=B
    c=int(input())
    N-=c
    if N<0:
        print(m+1)
        break
else:
    print("complete")

### FIXED CODE ###

A, B = map(int,input().split())
print(A*B if A<=9 and B<=9 else -1)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, len(A)):
    A[i] += A[i - 1]
for i in range(1, len(B)):
    B[i] += B[i - 1]
A.insert(0, 0)
B.insert(0, 0)
r = 0
for i, a in enumerate(A):
    min_idx = 0
    max_idx = len(B) - 1
    while min_idx < max_idx:
        j = (min_idx + max_idx + 1) // 2
        k = K - A[i] - B[j]
        if k < 0:
            max_idx = j - 1
        else:
            min_idx = j
    j = min_idx
    while j < len(B) and K - A[i] - B[j + 1] >= 0:
        j += 1
    if K - A[i] - B[j] >= 0:
        r = max(r, i + j)
print(r)

### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1, len(A)):
    A[i] += A[i - 1]
for i in range(1, len(B)):
    B[i] += B[i - 1]
A.insert(0, 0)
B.insert(0, 0)
r = 0
for i, a in enumerate(A):
    min_idx = 0
    max_idx = len(B) - 1
    while min_idx < max_idx:
        j = (min_idx + max_idx + 1) // 2
        k = K - A[i] - B[j]
        if k < 0:
            max_idx = j - 1
        else:
            min_idx = j
    j = min_idx
    while j + 1 < len(B) and K - A[i] - B[j + 1] >= 0:
        j += 1
    if K - A[i] - B[j] >= 0:
        r = max(r, i + j)
print(r)
n = input()
d = {"S":[none]*13, "H":[none]*13, "C":[none]*13, "D":[none]*13}

for i in range(n):
	x, y = raw_input().split()
	d[x][int(y)-1] = True

for k in ["S","H","C","D"]:
	for i in range(13):
		if not d[k][i]:
		print ("%s %d"%(k, i+1))

### FIXED CODE ###

n = int(raw_input())
lst = []
#store all the cards
for i in ["S","H","C","D"]:
	for j in xrange(1,14):
		lst.append("{0} {1}".format(i,j))
#discard the given cards
for i in range(n):
	a = raw_input()
	lst.remove(a)
#print the result
for i in range(len(lst)):
	print lst[i]
_,s,*a=map(int,open(0).read().split())
c,i,*d=[0]*s*9
for a in a:
 for j in range(s,0,-1):d[a+j]+=d[j]
 d[a]-=~i;c+=d[s];i+=1
print(c%(998244353))

### FIXED CODE ###

n,s,*a=map(int,open(0).read().split())
d=[0]*3001
c=0
for i,a in enumerate(a):
    for j in range(s-a,0,-1):d[a+j]+=d[j]
    d[a]-=~i
    c+=d[s]
print(c%(998244353))
import decimal
a,b = input().split()

b = decimal(b)

ans = a*b
print(int(ans))



### FIXED CODE ###

from decimal  import *
a,b = input().split()

b = Decimal(b)
a = Decimal(a)
ans = a*b
print(int(ans))
n=int(input())
max=-1000001;min=1000001;g=0;
num=[map(int,input().split())]
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
print(min,max,g)


### FIXED CODE ###

n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=list(map(int,input().split()))
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
 i+=1
print(min,max,g)
l = int(input().split())

a = int(l[0])
b = int(l[1])

n = b - a

h = n * (n + 1) // 2

print(h-b)

### FIXED CODE ###

l = input().split()

a = int(l[0])
b = int(l[1])

n = b - a

h = n * (n + 1) // 2

print(h-b)
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = [1]
for i in range(1,K + 1):
    a = A[B[i - 1] - 1]
    if a in B:
        x = B.index(a)
        y = i - x
        z = (K - x) % y
        print(B[x + z])
        exit()
    B.append(a)
if len(B) == K + 1:
    print(B[K])

### FIXED CODE ###

S = input()
T = input()
U = T[0:len(S)]
if U == S:
    print('Yes')
else:
    print('No')
S=input()
a=0
mod=[0]*2019
mod[0]+=1
for s in S:
 a+=(int(s)*(10**i))%2019
 b=a%2019
 mod[b]+=1
c=0
for i in range(2019):
 if mod[i]>=2:
  c+= mod[b]*(mod[b]-1)/2
print(int(c))


### FIXED CODE ###

S=input()
T=len(S)
a=0
d=1
mod=[0]*2019
mod[0]+=1
for i in range(T):
 a+=(int(S[T-i-1])*(d))%2019
 b=a%2019
 mod[b]+=1
 d*=10
 d%=2019
c=0
for i in range(2019):
 if mod[i]>=2:
  c+= mod[i]*(mod[i]-1)/2
print(int(c))
a=int(input())
b=int(input())

if a > b:
	c=a
	a=a-1
else:
	c=b
	b=b-1
	
if a > b:
	c+=a
else:
	c+=b
	
print(c)

### FIXED CODE ###

a,b = map(int,input().split())
c=0
for i in range(2):
	if a > b:
		c+=a
		a-=1
	else:
		c+=b
		b-=1

print(c)
R = int(input())
print(2*math.pi*R)

### FIXED CODE ###

import math
R = int(input())
print(2*math.pi*R)
tmp = input()
if tmp.isupper():
  print 'A'
else:
  print'a'

### FIXED CODE ###

def test(a):
	if a.isupper():
		print('A')
	else:
		print('a')

        
test(input())
import math

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

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

res = A[N - 1]
print(res)

### FIXED CODE ###

import fractions as f

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

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

res = A[N - 1]
print(res)