Harryxun/stf_run huggingface dataset:
N = input()

if N % 2 == 0:
  print(int(N))
else:
  print(int(2*N))

### FIXED CODE ###

N = int(input())
 
if N % 2 == 0:
  print(int(N))
else:
  print(int(2*N))
def select_pivot(a, i, j):
    n = j - i + 1
    if n < 3:
        return i
    else:
        b = [a[i], a[(i+j)/2], a[j]]
        t = b.sort()[1]
        if a[i] == t:
            return i
        elif a[j] == t:
            return j
        else:
            return (i+j) / 2
 
def quick_sort2(a, i, j):
    if j <= i:
        pass
    else:
        pivot = select_pivot(a, i, j); s = i
        x = a[pivot]
        a[pivot], a[j] = a[j], a[pivot]
        for k in range(i, j):
            if a[k] <= x:
                a[s], a[k] = a[k], a[s]
                s += 1
        a[j], a[s] = a[s], a[j]
        quick_sort2(a, i, s-1)
        quick_sort2(a, s+1, j)


puts a.join(' ')
n = int(raw_input())
A = map(int, raw_input().split())

quick_sort2(A, 0, n - 1)

print " ".join(map(str, A))

### FIXED CODE ###

n = int(raw_input())
x = map(int,raw_input().split())
x.sort()
for i in xrange(n):
	print x[i],
a = input()
b = input()

x = a * b
if x % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

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

x = i[0] * i[1]
if x % 2 == 0:
  print("Even")
else:
  print("Odd")
a = input()
b=3*a*a
print (b)


### FIXED CODE ###

a = int(input())
b=3*a*a
print (b)
N = int(input())
p = list(map(int, input().split()))
# print(p)
count = 0
for i in range(len(p)):
    # print(p[i])
    if i + 1 == p[i]:
        tmp = p[i]
        p[i] = p[i + 1]
        p[i + 1] = tmp
        count += 1
print(count)


### FIXED CODE ###

N = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(len(p)):
    if i + 1 == p[i]:
        if i + 1 != len(p):
            tmp = p[i]
            p[i] = p[i + 1]
            p[i + 1] = tmp
            count += 1
        else:
            tmp = p[i]
            p[i] = p[i - 1]
            p[i - 1] = tmp
            count += 1

print(count)
# -*- coding: utf-8 -*-

A, B, C, D = int(raw_input())
E = A*B-C*D

if E >= 0:
    print A*B
else:
    print C*D



### FIXED CODE ###

# -*- coding: utf-8 -*-

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

if A*B >= C*D:
    print(A*B)
else:
    print(C*D)
while True:
    a = raw_input().split(" ")
    a.sort()
    s = "%d %d" % (a[0],a[1])
    if s == "0 0":
        break
    print s

### FIXED CODE ###

while True:
    a = map(int,raw_input().split(" "))
    a.sort()
    s = "%d %d" % (a[0], a[1])
    if s == "0 0":
        break
    print s
# -*- coding:utf-8 -*-

def determine_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    elif rate >= 400 and rate <= 799:
        return 1
    elif rate >= 800 and rate <= 1199:
        return 2
    elif rate >= 1200 and rate <= 1599:
        return 3
    elif rate >= 1600 and rate <= 1999:
        return 4
    elif rate >= 2000 and rate <= 2399:
        return 5
    elif rate >= 2400 and rate <= 2799:
        return 6
    elif rate >= 2800 and rate <= 3199:
        return 7
    else:
        return 8


def solve():
    N = int(input())
    A = list(map(int, input().split()))

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、色が8の数だけ他の色を埋めていく。それが最大の数。

    """
    min_colors = [False] * 8
    max_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
        max_colors[color] = True

    k = 0
    for i in range(color8_cnt):
        if k == len(max_colors)-1:
            break

        for j in range(k, len(max_colors)):
            k = j
            if not max_colors[j]:
                max_colors[j] = True
                break
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1

    max_ans = 0
    for i, c in enumerate(max_colors):
        if c:
            max_ans += 1

    print(f"{min_ans} {max_ans}")



if __name__ == "__main__":
    solve()


### FIXED CODE ###

# -*- coding:utf-8 -*-

def determine_color(rate):
    if rate >= 1 and rate <= 399:
        return 0
    elif rate >= 400 and rate <= 799:
        return 1
    elif rate >= 800 and rate <= 1199:
        return 2
    elif rate >= 1200 and rate <= 1599:
        return 3
    elif rate >= 1600 and rate <= 1999:
        return 4
    elif rate >= 2000 and rate <= 2399:
        return 5
    elif rate >= 2400 and rate <= 2799:
        return 6
    elif rate >= 2800 and rate <= 3199:
        return 7
    else:
        return 8


def solve():
    N = int(input())
    A = list(map(int, input().split()))

    """方針
    色が8のとき、何色にもなれる。

    先に0~7の色を埋める(Trueにして)。これが最小の数。
    
    その後、最小の数に、色が8の数を足す。それが最大の数。

    問題文に書かれている色以外にもなれることに注意。黒色とか。
    """
    min_colors = [False] * 8
    color8_cnt = 0
    for i, a in enumerate(A):
        color = determine_color(a)
        if color == 8:
            color8_cnt += 1
            continue
        min_colors[color] = True
    
    min_ans = 0
    for i, c in enumerate(min_colors):
        if c:
            min_ans += 1
    
    max_ans = min_ans
    max_ans += color8_cnt

    if min_ans == 0 and color8_cnt != 0:
        min_ans = 1

    print("{} {}".format(min_ans, max_ans))



if __name__ == "__main__":
    solve()
k,s = map(int, input().split())

count = 0
for i in range(k+1):
    if s-i > k:
        rang = k
    else:
        rang = s-i
    for j in range(rang+1):
        if s-i-j < 0:
            continue
        elif s-i-j > k:
            rangg = k
        else:
            rang = s-i-j
        for h in range(rang+1):
            if i+j+h == s:
                count += 1

print(count)

### FIXED CODE ###

print(str(input().replace(","," ")))
s = input().split()
n = int(input())
a +=s.count('+')
b  -= s.count('-')
print(n-a-b)


### FIXED CODE ###

s = input()
n, m  = s.count('+'), s.count('-')
print(n-m)
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]
BC = sorted(BC, key=lambda x: x[1], reverse=True)
A.sort()
i = 0
for bc in BC:
    for _ in range(bc[0]):
        if bc[1] > A[i]:
            A[i] = bc[1]
            i += 1
        else:
            break

print(sum(A))


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for i in range(M)]
BC = sorted(BC, key=lambda x: x[1])
A.sort()
i = 0
for b, c in BC[::-1]:
    for _ in range(b):
        if i == N:
            break
        if c > A[i]:
            A[i] = c
            i += 1
        else:
            break

print(sum(A))
n,m = map(int,input().split())
x = list(map(int,input().split()))
x.sort()
a = []
ans = 0
for i in range(m-1):
  a.append(x[i+1]-x[i])
a.sort()
if n >= m:
  print(0)
else:
  for i in range(m-n):
    ans += a[i]
  print(ans)


### FIXED CODE ###

t,x = map(int,input().split())
print(t/x)
import sys
for line in sys.stdin.readlines():
    list=map(float,line.split())
    x=list[0:6:2]
    y=list[1:6:2]
    xp=list[6]
    yp=list[7]
    xv=[x[a%3]-x[(a+1)%3] for a in xrange(4)]
    yv=[y[a%3]-y[(a+1)%3] for a in xrange(4)]
    xpv=[xp-x[a] for a in xrange(3)]
    ypv=[yp-y[a] for a in xrange(3)]
    cross=[xv[i]*ypv[i]-yv[i]*xpv[i] for i in xrange(3)]
    sorted(cross)
    if (cross[2]>0 and cross[0]>0) or (cross[2]<0 and cross[0]<0): 
        print "YES"
    else:
        print "NO"

### FIXED CODE ###

import sys
for line in sys.stdin.readlines():
    try:
        list=map(float,line.split())
        x=list[0:6:2]
        y=list[1:6:2]
        xp=list[6]
        yp=list[7]
        xv=[x[a%3]-x[(a+1)%3] for a in xrange(4)]
        yv=[y[a%3]-y[(a+1)%3] for a in xrange(4)]
        xpv=[xp-x[a] for a in xrange(3)]
        ypv=[yp-y[a] for a in xrange(3)]
        cross=[xv[i]*ypv[i]-yv[i]*xpv[i] for i in xrange(3)]
        if (cross[2]>0 and cross[1]>0  and cross[0]>0) or (cross[2]<0 and cross[1]<0 and cross[0]<0): 
            print "YES"
        else:
            print "NO"
    except:
        pass
#temp
#!usr/bin/env python3

import sys


def main():
    m, n = [int(col_row) for col_row in sys.stdin.readline().split()]
    matrix = [[0 for col in range(m)] for row in range(n)]
    vector = [0 for col in range(m)]

    for row in range(n):
        lst = [int(element) for element in sys.stdin.readline().split()]
        for col in range(m):
            matrix[row][col] += lst[col]

    for row in range(m):
        lst = [int(element) for element in sys.stdin.readline().split()]
        vector[row] += lst[0]

    for row in range(n):
        sum_of_row = 0
        for col in range(m):
            sum_of_row += matrix[row][col] * vector[col]
        # res.append(sum_of_row)
        print(sum_of_row)


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!usr/bin/env python3

import sys


def init_matrix_vector():
    m, n = [int(col_row) for col_row in sys.stdin.readline().split()]
    matrix = [[0 for col in range(n)] for row in range(m)]
    vector = [0 for row in range(n)]

    for row in range(m):
        lst = [int(element) for element in sys.stdin.readline().split()]
        for col in range(n):
            matrix[row][col] += lst[col]

    for row in range(n):
        lst = [int(element) for element in sys.stdin.readline().split()]
        vector[row] += lst[0]

    return matrix, vector


def print_matrix_vector_multiplication_result(matrix, vector):
    for row in range(len(matrix)):
        sum_of_row = 0
        for col in range(len(vector)):
            sum_of_row += matrix[row][col] * vector[col]
        print(sum_of_row)


def main():
    matrix, vector = init_matrix_vector()
    print_matrix_vector_multiplication_result(matrix, vector)


if __name__ == '__main__':
    main()
#4問目
import math
A, B = map(int, input().split())

count = 0
gcd = math.gcd(A,B)

def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array

def isPrime(n):
    if n <= 2:
        return True
    for p in range(2, n):
        if n % p == 0:
            return False
    return True

dev = devisor(gcd)
for i in dev:
    if isPrime(i):
        count += 1
print(count)

### FIXED CODE ###

#4問目
import math
import fractions
import collections
A, B = map(int, input().split())

count = 0
gcd = fractions.gcd(A,B)

def devisor(num):
    array = []
    for i in range(1, math.floor(math.sqrt(num)) + 1):
        if(num % i == 0):
            array.append(i)
            array.append(math.floor(num / i))
    return array

def prime(n):
    prime = []
    while n % 2 == 0:
        prime.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            prime.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        prime.append(n)
    return prime

print(len(collections.Counter(prime(gcd))) + 1)
def main():
    inNum = map(int,input().split())
    A=inNum[0]
    B=inNum[1]
    C=inNum[2]
    if A == B:
        if B==C:
            print('No')
        else:
            print('Yes')
    else:
        print('Yes')

main()

### FIXED CODE ###

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

if A == B or B == C or C == A:
    if A == B and B == C:
        print("No")
    else:
        print("Yes")

else:
    print("No")
import sys
from functools import lru_cache
sys.setrecursionlimit(2*10**4)

# 入力
N, M = map(int, input().split())
A = list(map(int, input().split()))

INF = 10**15
# 各数字の消費マッチ棒
C = (100, 2, 5, 5, 4, 5, 6, 3, 7, 6)


# N=nのときの解に対応するベクトルを返す
@lru_cache(maxsize=None)
def dfs(n):
    return (
        [-INF for _ in range(9)] if n < 0 else
        [0 for _ in range(9)] if n == 0 else
        max(
            (
                [
                    t + 1 if i == a else t
                    for i, t in enumerate(dfs(n - C[a]), start=1)
                ]
                for a in A
            ),
            key=lambda x: [sum(x)] + list(reversed(x))
        )
    )


# 出力
ans = ''.join(str(a) * dfs(N)[a - 1] for a in sorted(A, reverse=True))
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
C = (100, 2, 5, 5, 4, 5, 6, 3, 7, 6)

dp = [[0 for _ in range(10)] for _ in range(N + 1)]
dp2 = [-100 for _ in range(N + 1)]
dp2[0] = 0

for i in range(2, N+1):
    x = -1
    opt = -1
    for a in A:
        c = C[a]
        if i >= c and (dp2[i - c] > opt or (dp2[i - c] == opt and a > x)):
            x = a
            opt = dp2[i - c]
    if x == -1:
        continue
    dp2[i] = dp2[i - C[x]] + 1
    c = C[x]
    for a in A:
        if x == a:
            dp[i][a] = dp[i - c][a] + 1
        else:
            dp[i][a] = dp[i - c][a]

ans = ''.join(str(a) * dp[N][a] for a in sorted(A, reverse=True))
print(ans)
N, M = map(int, input().split())
has_broken = [True, True, False] + [False for _ in range(N)]
prev_a = int(input())
has_broken[prev_a+2] = True
for _ in range(M-1):
    a = int(input())
    # 壊れているのが連続していたら上がれない
    if prev_a == a+1:
        print(0)
        exit(0)
    has_broken[a+2] = True


# dp[i] := i段目にたどり着く移動方法の総数
# 一歩で1段か2段上れるのだから、dp[i]は前段と前々段へたどり着く方法の和
# dp[i] = dp[i-1] + dp[i-2]
# dp配列は-1段目と-2段目の分大きくなっています
dp = [0 for _ in range(N+3)]
# 一段目初期化
dp[2] = 1

for i in range(2, N+3):
    if not has_broken[i]:
        dp[i] += dp[i-1] + dp[i-2]

print(dp[N+2]%1000000007)

### FIXED CODE ###

import sys


input = sys.stdin.readline

N, M = map(int, input().split())
has_broken = [1]*(N+1)
for _ in range(M):
    has_broken[int(input())] = 0

dp = [1]*(N+1)
dp[1] = 1 if has_broken[1] == 1 else 0
MOD = 10**9+7
for i in range(2, N+1):
    dp[i] = has_broken[i]*(dp[i-1] + dp[i-2])

print(dp[N]%MOD)
import sys


class BinaryIndexedTree(object):
    __slots__ = ["tree"]

    def __init__(self, size: int):
        self.tree = [0]*(size+1)

    def add(self, index: int, value: int) -> None:
        tree = self.tree
        next_index = index + 1

        while next_index < len(tree):
            tree[next_index] += value
            next_index += next_index & -next_index

    def sum(self, index: int):
        tree, result = self.tree, 0
        next_index = index + 1

        while next_index:
            result += tree[next_index]
            next_index -= next_index & -next_index

        return result


if __name__ == "__main__":
    n, q = map(int, input().split())
    bit = BinaryIndexedTree(n)
    result = []
    for com, x, y in (map(int, l.split()) for l in sys.stdin):
        if not com:
            bit.add(x, y)
        else:
            result.append(bit.sum(y) - bit.sum(x-1))

    print(*result, sep="\n")


### FIXED CODE ###

import math


class SegmentTree:
    __slots__ = ["elem_size", "tree_size", "tree"]

    def __init__(self, a: list, default: int):
        real_size = len(a)
        self.elem_size = 1 << math.ceil(math.log2(real_size))
        self.tree_size = 2 * self.elem_size + 1
        self.tree = [default] * (self.elem_size - 1) + a + [default] * (self.elem_size - real_size)

    def get_range_index(self, x, y, k=0, l_end=0, r_end=None):
        '''[x, y], tree[k], [l_end, r_end)'''
        default, tree = 0, self.tree
        if r_end is None:
            r_end = self.elem_size

        if l_end == x and y == r_end-1:
            return tree[k]

        mid = (l_end + r_end) // 2
        left_y = y if y < mid-1 else mid-1
        right_x = x if x > mid else mid

        left = self.get_range_index(x, left_y, 2*k+1, l_end, mid) if x <= left_y else default
        right = self.get_range_index(right_x, y, 2*k+2, mid, r_end) if right_x <= y else default
        return left + right

    def get_value(self, x, y):
        tree = self.tree
        return self.get_range_index(x, y)

        # return sum(tree[n] for n in index_list)

    def update_tree(self, k: int):
        tree = self.tree

        while k > 0:
            k = (k-1) // 2
            left, right = tree[2*k+1], tree[2*k+2]
            tree[k] = left + right

    def set_value(self, i: int, value: int, op: str):
        k = self.elem_size - 1 + i
        if op == "=":
            self.tree[k] = value
        elif op == "+":
            self.tree[k] += value
        self.update_tree(k)


n, q = map(int, input().split())
rsq = SegmentTree([0]*n, 0)
ans = []
for _ in [0]*q:
    c, x, y = map(int, input().split())
    if c == 0:
        rsq.set_value(x-1, y, "+")
    else:
        ans.append(rsq.get_value(x-1, y-1))
print("\n".join([str(n) for n in ans]))
r = int(input())
p = from math import pi

print('{0} {1:.6f}'.format(r * r * p, r * 2 * p))

### FIXED CODE ###

import math
r = float(input())
p = math.pi

print('{0} {1:.6f}'.format(r * r * p, r * 2 * p))
l,r = list(map(int,input().split()))

l = l % 2019
r = r % 2019
l = min(l,r)
r = max(l,r)
ans = []
for i in range(l,r+1):
  for j in range(i,r+1):
    if i != j:
      ans += [(i * j) %2019]
      
print(min(ans))


### FIXED CODE ###

l,r = list(map(int,input().split()))
if r-l >= 2019:
  print(0)
  exit()
l = l % 2019
r = r % 2019
l = min(l,r)
r = max(l,r)
ans = []
if r == l:
  print(0)
  exit()
for i in range(l,r+1):
  for j in range(i,r+1):
    if i != j:
      ans += [(i * j) %2019]
      
print(min(ans))
a,b = map(int ,input().split())
if(a*b % 2 == 0):
	return("Even")
return("Odd")

### FIXED CODE ###

a, b = map(int,input().split())
if(a*b)%2==0:
	print("Even")
else:
	print("Odd")
A,B,C = map(int,input().split())
if A == b and B == C:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

A,B,C = map(int,input().split())
if A == B and B == C:
  print('Yes')
else:
  print('No')
import networkx as nx

def main():
  N,M=map(int,input().split())
  S = [list(input()) for _ in range(N)]

  if N == M == 1:
    print(0)
    print(S[0][0])
    exit()

  index = lambda i,j: i*M+j

  G=nx.Graph()
  dx,dy=(1,0),(0,1)
  E = []
  n1,n2 = [],[]
  for i in range(N):
    for j in range(M):
      if S[i][j]=='#':continue
      if (i+j)%2:
        n1.append(index(i,j))
      else:
        n2.append(index(i,j))
      for k in range(2):
        v1,v2 = index(i,j),index(i+dx[k],j+dy[k])
        if not (0<=i+dx[k]<N and 0<=j+dy[k]<M):
          continue
        if S[i+dx[k]][j+dy[k]] == '#': continue
        if (i+j) % 2:
          E.append((v2,v1))
        else:
          E.append((v1,v2))
     
  G.add_nodes_from(n1, bipartite=0)
  G.add_nodes_from(n2, bipartite=1)
  G.add_edges_from(E)
  match = nx.bipartite.maximum_matching(G)
  match = {v:match[v] for v in match.keys() if v < match[v]}
 
  for v in match.keys():
    i1,j1 = divmod(v,M)
    i2,j2 = divmod(match[v],M)
    if i1 > i2 or j1 > j2:
      (i1,j1),(i2,j2) = (i2,j2),(i1,j1)
    if i1 < i2:
      S[i1][j1] = 'v'
      S[i2][j2] = '^'
    else:
      S[i1][j1] = '>'
      S[i2][j2] = '<'

  print(len(match))
  for i in range(N):
    print(''.join(S[i]))
    
if __name__ == "__main__":
  main()

### FIXED CODE ###

import networkx as nx

def main():
  N,M=map(int,input().split())
  S = [list(input()) for _ in range(N)]

  if N == M == 1:
    print(0)
    print(S[0][0])
    exit()

  index = lambda i,j: i*M+j

  G=nx.Graph()
  dx,dy=(1,0),(0,1)
  E = []
  n1,n2 = [],[]
  for i in range(N):
    for j in range(M):
      if S[i][j]=='#':continue
      if (i+j)%2:
        n1.append(index(i,j))
      else:
        n2.append(index(i,j))
      for k in range(2):
        v1,v2 = index(i,j),index(i+dx[k],j+dy[k])
        if not (0<=i+dx[k]<N and 0<=j+dy[k]<M):
          continue
        if S[i+dx[k]][j+dy[k]] == '#': continue
        if (i+j) % 2:
          E.append((v2,v1))
        else:
          E.append((v1,v2))
     
  G.add_nodes_from(n1, bipartite=0)
  G.add_nodes_from(n2, bipartite=1)
  G.add_edges_from(E)
  u = [n for n in G.nodes if G.nodes[n]['bipartite'] == 0]
  match = nx.bipartite.maximum_matching(G, top_nodes=u)
  match = {v:match[v] for v in match.keys() if v < match[v]}
 
  for v in match.keys():
    i1,j1 = divmod(v,M)
    i2,j2 = divmod(match[v],M)
    if i1 > i2 or j1 > j2:
      (i1,j1),(i2,j2) = (i2,j2),(i1,j1)
    if i1 < i2:
      S[i1][j1] = 'v'
      S[i2][j2] = '^'
    else:
      S[i1][j1] = '>'
      S[i2][j2] = '<'

  print(len(match))
  for i in range(N):
    print(''.join(S[i]))
    
if __name__ == "__main__":
  main()
x, y = map(int, input().split())
if x * 2 > y:
    flag = False
elif x * 4 < y:
    flag = False
elif (y - x * 2) % 2 == 0:
    flag = True

print('Yes' if flag == True else 'No')

### FIXED CODE ###

x, y = map(int, input().split())
if x * 2 > y:
    flag = False
elif x * 4 < y:
    flag = False
elif (y - x * 2) % 2 == 0:
    flag = True
else:
    flag = False

print('Yes' if flag == True else 'No')
def gcd(a,b):
  return [i for i in range(1,min(a,b)+1) if a%i == 0 and b%i == 0]
   
A, B, K = map(int, input().split())
ans = gcd(A,B)
print(ans[K+1])

### FIXED CODE ###

def gcd(a,b):
  return [i for i in range(1,min(a,b)+1) if a%i == 0 and b%i == 0]
   
A, B, K = map(int, input().split())
ans = gcd(A,B)
print(ans[-1*K])
n,l=map(int,raw_input().split())
a=[0]+[int(raw_input()) for _ in xrange(n)]+[0]
r=[0]*(n+2)
for i in xrange(1,n+1):
    if a[i-1]<a[i] and a[i]>a[i+1]:
        r[i]=0
    elif a[i-1]<a[i] and a[i]<a[i+1]:
        r[i]=1
    elif a[i-1]>a[i] and a[i]>a[i+1]:
        r[i]=1
    else:
        r[i]=2
time=[0]*(n+2)
while r!=[-1]*(n+2):
    for i in xrange(1,n+1):
        if r[i]==0:
            r[i]=-1
            time[i]+=l-a[i]
            time[i-1]=max(time[i-1],time[i])
            time[i+1]=max(time[i+1],time[i])
            if r[i-1]!=-1:r[i-1]-=1
            if r[i+1]!=-1:r[i+1]-=1
print(max(time))

### FIXED CODE ###

import heapq

n,l=map(int,raw_input().split())
a=[[0,0]]+[[0,i] for i in xrange(n)]+[[0,n+1]]
for i in xrange(n):
    en=int(raw_input())
    a[i]=[-en,i]
pq=[]
for i in xrange(n+2):
    heapq.heappush(pq,a[i])
ti=[0]*(n+2)
while 1:
    p,i=heapq.heappop(pq)
    p=-p
    if p==0:break
    ti[i]+=l-p
    a[i][0]=0
    if a[i-1][0]!=0:
        ti[i-1]=max(ti[i-1],ti[i])
    if a[i+1][0]!=0:
        ti[i+1]=max(ti[i+1],ti[i])
print(max(ti))
N,M = map(int,input().split())
L = []
R = []
count = 0
for j in range(M):
  L,R = map(int,input().split())
for i in range(N+1):
  if i > max(L) and i < min(R):
    count += 1

### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
ans = 0
for _ in range(M):
  l, r = map(int, input().split())
  L.append(l)
  R.append(r)
ans = max(0,min(R) - max(L) + 1)
print(ans)
import numpy as np

def main(n,k,a):
  # Worst Case
  #n,k=100000,100
  #a=[p for p in range(100000)]
  
  kl=[p for p in range(1,k+1)]
  dp=[10**9]*(n)
  dp[0]=0
  for i in range(n):
    for j in kl:
      ij=i+j
      if ij < n:
        m=dp[i]+abs(a[i]-a[ij])
        if m < dp[ij]:
          dp[ij]=m
  print(dp[n-1])

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main','(i4,i4,i4[:])')(main)
    cc.compile()

if __name__ == '__main__':
    import sys
    if sys.argv[-1] == 'ONLINE_JUDGE':
    #if True:
      cc_export()
      exit(0)
    from my_module import main
    n,k=map(int,input().split())
    a=np.array(list(map(int,input().split())))    
    main(n,k,a)
    
    



### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
#n,k=100000,100
#a=[i for i in range(100000)]

kl=[i for i in range(1,k+1)]

dp=[float("inf")]*(n)
dp[0]=0
for i in range(1,n):
  dp[i] = min(dp[j] + abs(a[i] - a[j]) for j in range(max(0, i - k), i))

print(dp[n-1])
import math
from decimal import *

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

print("Yes" Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt if else "No")


### FIXED CODE ###

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

if c - a - b > 0 and 4 * a * b < (c - a - b)**2:
    print("Yes")
else:
    print("No")
a=input()
b=input()
c=input()
x=input()
ans=0
for i in range(a):
  for j in range(b):
    for k in range(c):
      if x==500*i+100*j+50*k:
        ans+=1
print(ans)

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if x==500*i+100*j+50*k:
        ans+=1
print(ans)