Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))


def m():
    first = V[0::2]
    second = V[1::2]
    fdic = {}
    sdic = {}
    for i in range(N//2):
        if fdic.get(first[i], 0) == 0:
            fdic[first[i]] = 1
        else:
            fdic[first[i]] +=1

        if sdic.get(second[i], 0) == 0:
            sdic[second[i]] = 1
        else:
            sdic[second[i]] +=1
    flist = list(fdic.items())
    slist = list(sdic.items())

    flist.sort(reverse=True, key=lambda x:x[1])
    slist.sort(reverse=True, key=lambda x:x[1])

    if flist[0][0] != slist[0][0] and len(flist) == 1 and len(slist) == 1:
        return 0

    if flist[0][0] != slist[0][0]:
        ans = 0
        for k, v in flist[1:]:
            ans += v
        for k, v in slist[1:]:
            ans += v
        return ans

    if flist[0][1] > slist[0][1]:
        ans = 0
        for k, v in flist[1:]:
            ans += v
        for k, v in slist[2]:
            ans += v
        ans += slist[0][0]
        return ans
    else:
        ans = 0
        for k, v in slist[1:]:
            ans += v
        for k, v in flist[2]:
            ans += v
        ans += flist[0][0]
        return ans

print(m())

Fixed submission:
N = int(input())
V = list(map(int, input().split()))


def m():
    first = V[0::2]
    second = V[1::2]
    fdic = {}
    sdic = {}
    for i in range(N//2):
        if fdic.get(first[i], 0) == 0:
            fdic[first[i]] = 1
        else:
            fdic[first[i]] +=1

        if sdic.get(second[i], 0) == 0:
            sdic[second[i]] = 1
        else:
            sdic[second[i]] +=1
    flist = list(fdic.items())
    slist = list(sdic.items())

    flist.sort(reverse=True, key=lambda x:x[1])
    slist.sort(reverse=True, key=lambda x:x[1])

    if len(flist) == 1 and len(slist) == 1:
        if flist[0][0] == slist[0][0]:
            return N//2
        return 0
    if len(flist) == 1:
        return N//2 - slist[0][1]
    if len(slist) == 1:
        return N//2 - flist[0][1]

    if flist[0][0] != slist[0][0]:
        ans = 0
        for k, v in flist:
            if k != flist[0][0]:
                ans += v
        for k, v in slist:
            if k != slist[0][0]:
                ans += v
        return ans

    fans = 0
    sans = 0
    for k, v in flist:
        if k != flist[0][0]:
            fans += v
    for k, v in slist:
        if k != slist[1][0]:
            fans += v

    for k, v in flist:
        if k != flist[1][0]:
            sans += v
    for k, v in slist:
        if k != slist[0][0]:
            sans += v
    return min(fans,sans)

print(m())
Buggy python submission (verdict: Time Limit Exceeded):
def after_explain():
    d, g = map(int, input().split())
    a = []
    b = []
    for i in range(d):
        p, c = map(int, input().split())
        a.append(p)
        b.append(c)

    mincnt = 999999999
    for i in range(1 << 2 * d):
        score = 0
        cnt = 0
        for j in range(d):
            if i & (1 << j):
                score += a[j]*(j+1)*100 + b[j]
                cnt += a[j]

        for j in range(d-1, -1, -1):
            if not(i & (1 << j)):
                if score > g:
                    break
                s = g - score
                if s % ((j+1)*100) == 0:
                    c = min(a[j], s // ((j + 1) * 100))
                    cnt += c
                    score += c * ((j + 1) * 100)
                else:
                    c = min(a[j], s // ((j + 1) * 100))
                    cnt += c + 1
                    score += (c+1) * ((j + 1) * 100)
                break
        if score < g:
            continue
        if cnt < mincnt:
            mincnt = cnt
    return mincnt

print(after_explain())

Fixed submission:
def after_explain():
    d, g = map(int, input().split())
    a = []
    b = []
    for i in range(d):
        p, c = map(int, input().split())
        a.append(p)
        b.append(c)

    mincnt = 999999999
    for i in range(1 << 2 * d):
        score = 0
        cnt = 0
        for j in range(d):
            if i & (1 << j):
                score += a[j]*(j+1)*100 + b[j]
                cnt += a[j]

        for j in range(d-1, -1, -1):
            if not(i & (1 << j)):
                if score > g:
                    break
                s = g - score
                if s % ((j+1)*100) == 0:
                    c = min(a[j], s // ((j + 1) * 100))
                    cnt += c
                    score += c * ((j + 1) * 100)
                else:
                    c = min(a[j], s // ((j + 1) * 100))
                    cnt += c + 1
                    score += (c+1) * ((j + 1) * 100)
                break
        if score < g:
            continue
        if cnt < mincnt:
            mincnt = cnt
    return mincnt

print(after_explain())
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10*6)

def m():
    n, m = map(int, input().split())
    p = list(map(int, input().split()))
    g = [[] for _ in range(n+1)]
    for _ in range(m):
        x, y = map(int, input().split())
        g[x].append(y)
        g[y].append(x)
    color = [-1] * (n+1)

    def dfs(v, c):
        s = []
        s.append(v)
        color[v] = c
        while len(s) != 0:
            a = s.pop()
            for elem in g[a]:
                if color[elem] == -1:
                    dfs(elem, c)

    k = 0
    for i in range(1, n):
        if color[i] == -1:
            dfs(i,k)
            k +=1
    ans = 0
    for i in range(n):
        if color[p[i]] == color[i+1]:
            ans +=1
    return ans

print(m())

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

def m():
    n, m = map(int, input().split())
    p = list(map(int, input().split()))
    g = [[] for _ in range(n+1)]
    for _ in range(m):
        x, y = map(int, input().split())
        g[x].append(y)
        g[y].append(x)
    color = [-1] * (n+1)

    def dfs(v, c):
        s = []
        s.append(v)
        color[v] = c
        while len(s) != 0:
            a = s.pop()
            for elem in g[a]:
                if color[elem] == -1:
                    dfs(elem, c)

    k = 0
    for i in range(1, n):
        if color[i] == -1:
            dfs(i,k)
            k +=1
    ans = 0
    for i in range(n):
        if color[p[i]] == color[i+1]:
            ans +=1
    return ans

print(m())
Buggy python submission (verdict: Time Limit Exceeded):
def m():
    N = int(input())
    X = [int(x) for x in input().split()]
    for x in range(N):
        XX = [x for x in X]
        XX[x] = -1
        XX.sort()
        print(XX[N//2])


m()


Fixed submission:
def m():
    N = int(input())
    X = [int(x) for x in input().split()]
    XX = [x for x in X]
    XX.sort()
    first = XX[N//2]
    second = XX[N//2 -1]
    for x in range(N):
        if X[x] <= second:
            print(first)
        else:
            print(second)


m()
Buggy python submission (verdict: Runtime Error):

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

    def comb(x, y):
        c = 1
        p = 1
        for i in range(y, 0, -1):
            c = c * i
        for i in range(x, x - y, -1):
            p = p * i
        return p / c

    p = max(a)
    want_near = p // 2
    tmp = 1
    tmpdiff = 9999999
    for i in a:
        diff = abs(i - want_near)
        if diff < tmpdiff:
            tmpdiff = diff
            tmp = i

    return "{0} {1}".format(p, tmp)


print(m())


Fixed submission:
def someone_ans():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    x_max = a[n - 1]
    center = a[0]
    for i in range(1, n - 1):
        if abs(center - x_max / 2) > abs(a[i] - x_max / 2):
            center = a[i]
    return "{0} {1}".format(x_max, center)


print(someone_ans())

Buggy python submission (verdict: Time Limit Exceeded):
def m():
    n = int(input())
    a = list(map(int, input().split()))

    def comb(x, y):
        c = 1
        p = 1
        for i in range(y, 0, -1):
            c = c * i
        for i in range(x, x - y, -1):
            p = p * i
        return p / c

    a.sort(reverse=True)
    tmp = 0
    ans = ""
    for i, v in enumerate(a):
        for k in range(i+1, n):
            m = comb(v, a[k])
            if tmp < m:
                tmp = m
                ans = "{0} {1}".format(v, a[k])

    return ans


print(m())


Fixed submission:
def someone_ans():
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    x_max = a[n - 1]
    center = a[0]
    for i in range(1, n - 1):
        if abs(center - x_max / 2) > abs(a[i] - x_max / 2):
            center = a[i]
    return "{0} {1}".format(x_max, center)


print(someone_ans())
Buggy python submission (verdict: Runtime Error):
def main():
    A, B, K = map(int, input().split())
    r = set()
    for i in range(A, A + K):
        r.add(i)

    for i in range(B, B - K, -1):
        r.add(i)
    O = list(r).sort()
    for o in O:
        print(o)


main()


Fixed submission:
def main():
    A, B, K = map(int, input().split())
    r = set()
    for i in range(A, A + K):
        if A <= i and B >= i:
            r.add(i)

    for i in range(B, B - K, -1):
        if A <= i and B >= i:
            r.add(i)
    O = list(r)
    O.sort()
    for o in O:
        print(o)


main()
Buggy python submission (verdict: Runtime Error):
def main():
    A, B, C = map(int, input().split())
    m = max(A, B, C)
    d = sum(A, B, C) - m
    if d % 2 == 0:
        print(d//2)
    else:
        print((d//2)+2)

main()


Fixed submission:
def main():
    A, B, C = map(int, input().split())
    m = [A,B,C]
    m.sort(reverse=True)
    d = (m[0] - m[1]) + (m[0] - m[2])
    if d % 2 == 0:
        print(d//2)
    else:
        print((d//2)+2)

main()
Buggy python submission (verdict: Time Limit Exceeded):
def m():
    h, w, d = map(int, input().split())
    a = [list(map(int, input().split())) for _ in range(h)]
    pre = [0] * ((h+1)*(w+1))
    for i in range(h):
        for j in range(w):
            pre[a[i][j]] = (i+1, j+1)
    q = int(input())

    for _ in range(q):
        power = 0
        l, r = map(int, input().split())
        for p in range(l+d, r+1, d):
            power += abs(pre[p][0]-pre[p-d][0])
            power += abs(pre[p][1]-pre[p-d][1])
        print(power)

m()

Fixed submission:
def m():
    h, w, d = map(int, input().split())
    a = [list(map(int, input().split())) for _ in range(h)]
    pre = [0] * ((h*w)+1)
    for i in range(h):
        for j in range(w):
            pre[a[i][j]] = (i+1, j+1)
    accum = [0] * len(pre)
    for i in range(d+1, len(pre)):
        accum[i] = accum[i - d] \
                   + abs(pre[i][0] - pre[i - d][0])\
                   + abs(pre[i][1] - pre[i - d][1])

    q = int(input())
    for _ in range(q):
        l, r = map(int, input().split())
        power = accum[r] - accum[l]
        print(power)

m()

Buggy python submission (verdict: Time Limit Exceeded):
def m():
    h, w, d = map(int, input().split())
    a = [list(map(int, input().split())) for _ in range(h)]
    pre = [0] * ((h+1)*(w+1))
    for i in range(h):
        for j in range(w):
            pre[a[i][j]] = (i+1, j+1)
    q = int(input())

    for _ in range(q):
        power = 0
        l, r = map(int, input().split())
        for p in range(l+d, r+1, d):
            power += abs(pre[p][0]-pre[p-d][0])
            power += abs(pre[p][1]-pre[p-d][1])
        print(power)

m()

Fixed submission:
def m():
    h, w, d = map(int, input().split())
    a = [list(map(int, input().split())) for _ in range(h)]
    pre = [0] * ((h*w)+1)
    for i in range(h):
        for j in range(w):
            pre[a[i][j]] = (i+1, j+1)
    accum = [0] * len(pre)
    for i in range(d+1, len(pre)):
        accum[i] = accum[i - d] \
                   + abs(pre[i][0] - pre[i - d][0])\
                   + abs(pre[i][1] - pre[i - d][1])

    q = int(input())
    for _ in range(q):
        l, r = map(int, input().split())
        power = accum[r] - accum[l]
        print(power)

m()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    x, y = map(int, input().split())
    if x == y:
        return print('-1')
    if y == 1:
        return print('-1')
    if x == 1:
        return print(y+1)
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()


Fixed submission:
def main():
    x, y = map(int, input().split())
    if x % y == 0:
        return print('-1')
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    x, y = map(int, input().split())
    if x == y:
        return print('-1')
    if y == 1:
        return print('-1')
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()


Fixed submission:
def main():
    x, y = map(int, input().split())
    if x % y == 0:
        return print('-1')
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    x, y = map(int, input().split())
    if x == y:
        return print('-1')
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()


Fixed submission:
def main():
    x, y = map(int, input().split())
    if x % y == 0:
        return print('-1')
    for i in range(1000000000):
        if (i * x) % y != 0:
            return print(i*x)
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, Y = [int(i) for i in input().split()]

    A = []
    B = []

    for i in range(N):
        a, b = [int(i) for i in input().split()]
        A.append(a)
        B.append(b)

    B.sort()
    B.reverse()
    A.sort()
    A.reverse()

    for i in range(1000000000):
        if Y <= 0:
            print(i)
            return

        b_m = max(B, default=0)
        a_m = max(A)
        if b_m > a_m:
            Y = Y - b_m
            B.remove(b_m)
        else:
            Y = Y - a_m


main()


Fixed submission:
def answer():
    import sys
    input = sys.stdin.readline
    wield = 0
    l = []
    N, H = map(int, input().split())
    for i in range(N):
        a, b = map(int, input().split())
        l.append(b)
        wield = max(a, wield)
    l.sort(reverse=True)
    ret = 0
    for a in l:
        if H <= 0:
            break
        if a > wield:
            ret += 1
            H -= a
        else:
            break
    if H > 0:
        ret += (H + wield - 1) // wield
    print(ret)
  
answer()
Buggy python submission (verdict: Time Limit Exceeded):
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q & 1 == 0: return False
    return pow(2, q - 1, q) == 1


def main():
    Q = int(input())
    dp = [-1 for _ in range(1000000)]
    for _ in range(Q):
        cnt = 0
        l, r = map(int, input().split())
        for x in range(l, r + 1):
            if dp[x] != -1:
                if dp[x] == 1:
                    cnt += 1
                    continue

            if is_prime(x) and is_prime((x+1)//2):
                dp[x] = 1
                cnt += 1
            else:
                dp[x] = 0

        print(cnt)

main()


Fixed submission:
def get_prime_array(N):
    f = [0] * (N + 1)
    for i in range(2, N + 1):
        if not f[i]:
            for j in range(i + i, N + 1, i):
                f[j] = 1
    return f


def ans():
    Q = int(input())
    f = get_prime_array(1000001)
    c = [0] * 1000002
    for i in range(3, 1000001, 2):
        if not f[i] and not f[(i + 1) // 2]:
            c[i] += 1

    for i in range(3, 1000000):
        c[i] = c[i] + c[i - 1]

    for _ in range(Q):
        l, r = map(int, input().split())
        print(c[r] - c[l-1])

ans()
Buggy python submission (verdict: Runtime Error):
def main():
    S = input()
    N = len(S)
    for k in range(N - 1, (N // 2) - 1, -1):
        first = S[0:k]
        union = k * 2 - N
        cut = first[-union:-1] + first[-1]
        if '1' in cut and '0' in cut:
            continue
        else:
            return print(k)


main()


Fixed submission:
def ans():
    S = input()
    N = len(S)
    if not ('1' in S and '0' in S):
        return print(N)

    tmp = 1000000
    for i, v in enumerate(S):
        if i == 0:
            continue
        if S[i-1] != v:
            tmp = min(max(i, N-i), tmp)
    return print(tmp)

# main()
ans()

Buggy python submission (verdict: Runtime Error):
def main():
    S = input()
    N = len(S)
    for k in range(N - 1, N // 2 - 1, -1):
        first = S[0:k]
        union = k * 2 - len(S)
        cut = first[-union:-1] + first[-1]
        if '1' in cut and '0' in cut:
            continue
        else:
            return print(k)


main()


Fixed submission:
def ans():
    S = input()
    N = len(S)
    if not ('1' in S and '0' in S):
        return print(N)

    tmp = 1000000
    for i, v in enumerate(S):
        if i == 0:
            continue
        if S[i-1] != v:
            tmp = min(max(i, N-i), tmp)
    return print(tmp)

# main()
ans()
Buggy python submission (verdict: Runtime Error):
def ans():
    tmp = -9999999999999
    N = int(input())
    F = [list(map(int, input().split())) for i in range(N)]
    P = [list(map(int, input().split())) for i in range(N)]

    def calculate(B):
        v = []
        for n in range(N):
            mcnt = 0
            for k in range(10):
                if B[k] == '1' and F[n][k] == 1:
                    mcnt += 1
            v.append(P[n][mcnt])
        return sum(v)

    for i in range(1, 1 << 10):
        bi = bin(i)
        bi = bi[2:]
        bi = '0' * (10 - len(bi)) + bi
        tmp = max(tmp, calculate(bi))
    return print(tmp)
  
  ans()

Fixed submission:
def ans():
    tmp = -9999999999999
    N = int(input())
    F = [list(map(int, input().split())) for i in range(N)]
    P = [list(map(int, input().split())) for i in range(N)]

    def calculate(B):
        v = []
        for n in range(N):
            mcnt = 0
            for k in range(10):
                if B[k] == '1' and F[n][k] == 1:
                    mcnt += 1
            v.append(P[n][mcnt])
        return sum(v)

    for i in range(1, 1 << 10):
        bi = bin(i)
        bi = bi[2:]
        bi = '0' * (10 - len(bi)) + bi
        tmp = max(tmp, calculate(bi))
    return print(tmp)


ans()
Buggy python submission (verdict: Time Limit Exceeded):
def m():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    cnt = 0
    for a in A:
        for b in B:
            for c in C:
                if a < b and b < c:
                    cnt +=1
    return cnt


print(m())

Fixed submission:
def someone_ans():
    def binary_search(L, key, mode):
        low, high = 0, len(L)
        mid = len(L) // 2
        while low <= high - 1:
            if L[mid] < key and mode == 0 or L[mid] <= key and mode == 1:
                low = mid + 1
            else:
                high = mid
            mid = (low + high) // 2
        return high

    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    C.sort()
    ans = 0
    for i in B:
        Ai = binary_search(A, i, 0)
        Ci = len(C) - binary_search(C, i, 1)
        ans += Ai*Ci
    return ans


# print(m())
print(someone_ans())
Buggy python submission (verdict: Time Limit Exceeded):
def m():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = []
    for a in A: ans.remove(a) if a in ans else ans.append(a)
    return len(ans)

print(m())


Fixed submission:
def m():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    tmp = -1
    cnt = 0
    ans = 0
    for i in range(N):
        if tmp == A[i]:
            cnt +=1
        else:
            if cnt % 2 == 0: pass
            else: ans +=1
            tmp = A[i]
            cnt = 1

    if cnt % 2 == 0: pass
    else: ans += 1
    return ans

print(m())

Buggy python submission (verdict: Time Limit Exceeded):
def m():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = []

    for a in A:
        if a in ans:
            ans.remove(a)
        else:
            ans.append(a)
    return len(ans)

print(m())


Fixed submission:
def m():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    A.sort()
    tmp = -1
    cnt = 0
    ans = 0
    for i in range(N):
        if tmp == A[i]:
            cnt +=1
        else:
            if cnt % 2 == 0: pass
            else: ans +=1
            tmp = A[i]
            cnt = 1

    if cnt % 2 == 0: pass
    else: ans += 1
    return ans

print(m())
Buggy python submission (verdict: Runtime Error):
def m():

    def is_satisfied(p):
        for i in range(N):
            if i+1 == p[i]: return False
        return True

    def swap(i):
        tmp = p[i]
        p[i] = p[i+1]
        p[i+1] = tmp

    N = int(input())
    p = list(map(int, input().split()))
    if is_satisfied(p):
        return 0

    cnt = 0
    for i in range(N):
        if i+1 == p[i]:
            swap(i)
            cnt +=1
    return cnt

print(m())

Fixed submission:
def m():
    def is_satisfied(p):
        for i in range(N):
            if i + 1 == p[i]: return False
        return True

    def swap(i):
        tmp = p[i]
        p[i] = p[i + 1]
        p[i + 1] = tmp

    N = int(input())
    p = list(map(int, input().split()))
    if is_satisfied(p):
        return 0

    cnt = 0
    for i in range(N):
        if i + 1 == p[i]:
            if i + 1 == N:
                cnt += 1
                tmp = p[i - 1]
                p[i - 1] = p[i]
                p[i] = tmp
            else:
                swap(i)
                cnt += 1
    return cnt


print(m())
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a, b = [], []
    to_n = []
    for _ in range(m):
        x, y = map(int, input().split())
        a.append(x)
        b.append(y)
        if y == n:
            to_n.append(x)

    for j in range(m):
        if a[j] == 1:
            if b[j] in to_n:
                return 'POSSIBLE'
    return 'IMPOSSIBLE'


print(main())

Fixed submission:
def main():
    n, m = map(int, input().split())
    a, b = [], []
    from_1 = set()
    to_n = set()
    for _ in range(m):
        x, y = map(int, input().split())
        if x == 1:
            from_1.add(y)
            continue
        if y == n:
            to_n.add(x)
            continue
    ans = from_1 & to_n
    if ans:
        return "POSSIBLE"

    return 'IMPOSSIBLE'


print(main())

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a, b = [], []
    for _ in range(m):
        x, y = map(int, input().split())
        a.append(x)
        b.append(y)
    to_n = []
    for i in range(m):
        if b[i] == n:
            to_n.append(a[i])

    for j in range(m):
        if a[j] == 1:
            if b[j] in to_n:
                return 'POSSIBLE'
    return 'IMPOSSIBLE'


print(main())

Fixed submission:
def main():
    n, m = map(int, input().split())
    a, b = [], []
    from_1 = set()
    to_n = set()
    for _ in range(m):
        x, y = map(int, input().split())
        if x == 1:
            from_1.add(y)
            continue
        if y == n:
            to_n.add(x)
            continue
    ans = from_1 & to_n
    if ans:
        return "POSSIBLE"

    return 'IMPOSSIBLE'


print(main())
Buggy python submission (verdict: Time Limit Exceeded):
def m():
    n = int(input())
    a = list(map(int, input().split()))
    s = a.copy()

    for i in range(1, n):
        a[i] = a[i] + a[i-1]

    ans = 999999999999
    for j in range(1, n):
        ans = min(ans, abs(sum(s[:j]) - sum(s[j:])))
    return ans
print(m())

Fixed submission:
def m():
    n = int(input())
    a = list(map(int, input().split()))
    b = a.copy()

    for i in range(1, n):
        b[i] = b[i] + b[i-1]
    for j in range(n-2, -1, -1):
        a[j] = a[j] + a[j+1]

    ans = 999999999999
    for j in range(n-1):
        ans = min(ans, abs(b[j] - a[j+1]))
    return ans
print(m())