Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
from heapq import heappush, heappop
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def ceil(a, b): return (a + b - 1) // b

YES = "Yes"
NO = "No"


def check(x, nums):
    x = abs(x)
    dp = [False] * (x + 1)
    dp[0] = True
    for y in nums:
        tmp = [False] * (x + 1)
        for i in range(len(dp)):
            if i + y < len(tmp):
                tmp[i + y] |= dp[i]
            if i - y >= 0:
                tmp[i - y] |= dp[i]
        dp = tmp
    return dp[x]


def solve(s, x, y):
    type_num = [(k, len(list(g))) for k, g in groupby(s)]
    if s[0] == "F":
        x -= type_num[0][1]
        type_num.pop(0)

    h, v = [], []
    now = 0
    for t, n in type_num:
        if t == "F":
            if now == 0:
                h.append(n)
            else:
                v.append(n)
        else:
            if n % 2 != 0:
                now = (now + 1) % 2
    return YES if check(x, h) and check(y, v) else NO


def main():
    s = input()
    x, y = map(int, input().split())

    print(solve(s, x, y))

if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
from heapq import heappush, heappop
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy4, dx4 = [0, -1, 0, 1], [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def ceil(a, b): return (a + b - 1) // b


def main():
    N = int(input())
    a = Counter(list(map(int, input().split())))

    ans = 0
    for k, v in a.items():
        if k == v:
            continue
        elif k < v:
            ans += v - k
        else:
            ans += v
    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N = int(input())
    F = [[0] * 10 for _ in range(N)]
    for i in range(N):
        s = input().split()
        for j in range(10):
            F[i][j] = int(s[j])
    P = [[0] * 10 for _ in range(N)]
    for i in range(N):
        s = input().split()
        for j in range(10):
            P[i][j] = int(s[j])

    ans = -INF
    # 2 ^ nの組み合わせの全列挙
    for b in range(1, 2 ** 10):
        o = [0] * 10
        for i in range(10):
            if b & 1 << i:
                o[i] = 1

        total = 0
        for i in range(N):
            c = 0
            for j in range(10):
                if o[j] == 1 and F[i][j] == 1:
                    c += 1
            total += P[i][c]
        ans = max(ans, total)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N = int(input())
    F = [[0] * 10 for _ in range(N)]
    for i in range(N):
        s = input().split()
        for j in range(10):
            F[i][j] = int(s[j])
    P = [[0] * 11 for _ in range(N)]
    for i in range(N):
        s = input().split()
        for j in range(11):
            P[i][j] = int(s[j])

    ans = -INF
    # 2 ^ nの組み合わせの全列挙
    for b in range(1, 2 ** 10):
        o = [0] * 10
        for i in range(10):
            if b & 1 << i:
                o[i] = 1

        total = 0
        for i in range(N):
            c = 0
            for j in range(10):
                if o[j] == 1 and F[i][j] == 1:
                    c += 1
            total += P[i][c]
        ans = max(ans, total)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N, C = list(map(int, input().split()))
    a = []
    check_set = set()
    for _ in range(N):
        s, t, c = list(map(int, input().split()))
        a.append((s - 0.5, s, t, c))
        check_set.add((s - 0.5, c))
        check_set.add((s, c))
        check_set.add((t - 0.01, c))

    ans = 0
    for t1, c1 in check_set:
        total = 0
        for sp2, s2, t2, c2 in a:
            if c1 == c2:
                total += s2 <= t1 <= t2
            else:
                total += sp2 <= t1 <= t2
        ans = max(ans, total)
    print(ans)

    
if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N, C = list(map(int, input().split()))

    s_t_c = []
    for i in range(N):
        s, t, c = list(map(int, input().split()))
        s_t_c.append((s, t, c))

    ans = [0] * (2 * 10 ** 5 + 2)
    for i in range(1, C + 1):
        dp = [0] * (2 * 10 ** 5 + 2)

        for s, t, c in s_t_c:
            if c == i:
                dp[s * 2 - 1] += 1
                dp[t * 2] -= 1
        for j in range(1, len(dp)):
            dp[j] += dp[j - 1]

        for j in range(len(dp)):
            ans[j] += dp[j] > 0

    print(max(ans))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)

a = []
@lru_cache(None)
def dfs(no, i):
    global a

    ans = abs(a[-1] - a[i])
    for j in range(i + 1, len(a) - 1):
        nex = dfs(1 - no, j + 1)
        # X
        if no % 2 == 0:
            ans = max(ans, nex)
        # Y
        else:
            ans = min(ans, nex)
    return ans


def solve2(N, Z, W):
    global a
    a = [Z, W] + a
    return dfs(0, 1)


def solve(N, Z, W):
    global a
    ans = abs(a[-1] - W)
    if len(a) > 1:
        ans = max(ans, abs(a[-2] - a[-1]))
    return ans


def main():
    global a
    N, Z, W = map(int, input().split())
    a = list(map(int, input().split()))
    print(solve2(N, Z, W))


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N, Z, W = map(int, input().split())
    a_list = list(map(int, input().split()))

    ans = 0
    ans = max(ans, abs(a_list[-1] - W))
    if N >= 2:
        ans = max(ans, abs(a_list[-2] - a_list[-1]))
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")

from bisect import bisect, bisect_left, bisect_right



# Find rightmost value less than x
def find_lt(a, x):
    i = bisect_left(a, x)
    if i:
        return i
    raise ValueError



# Find leftmost value greater than x'
def find_gt(a, x):
    i = bisect_right(a, x)
    if i != len(a):
        return i
    raise ValueError




def main():
    N = int(input())
    A = list(sorted(list(map(int, input().split()))))
    B = list(sorted(list(map(int, input().split()))))
    C = list(sorted(list(map(int, input().split()))))

    ans = 0
    for b in B:
        a = find_lt(A, b)
        b = N - find_gt(C, b)
        ans += a * b
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")

from bisect import bisect, bisect_left, bisect_right



# Find rightmost value less than x
def find_lt(a, x):
    i = bisect_left(a, x)
    if i:
        return i
    return 0


# Find leftmost value greater than x'
def find_gt(a, x):
    i = bisect_right(a, x)
    if i != len(a):
        return i
    return len(a)


def main():
    N = int(input())
    A = list(sorted(list(map(int, input().split()))))
    B = list(sorted(list(map(int, input().split()))))
    C = list(sorted(list(map(int, input().split()))))

    ans = 0
    for b in B:
        a = find_lt(A, b)
        b = N - find_gt(C, b)
        ans += a * b
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


memo1 = {}
memo2 = {}

def ok(y1, y2, x1, x2, yd, yd2, xd, xd2, K):
    global memo1, memo2
    if (y1, y2) in memo1:
        a, b = memo1[(y1, y2)]
    else:
        a = yd2[y1]
        b = yd[y2]
        memo1[(y1, y2)] = (a, b)
    y = b.difference(a)

    if (x1, x2) in memo2:
        c, d =memo2[(x1, x2)]
    else:
        c = xd2[x1]
        d = xd[x2]
        memo2[(x1, x2)] = (c, d)

    x = d.difference(c)
    # print(a, b, c, d)
    # print(y, x)

    n = len(y & x)

    return n >= K


def main():
    N, K = map(int, input().split())
    f = []
    ys, xs = [], []
    for i in range(N):
        x, y = map(int, input().split())
        f.append((y, x))
        ys.append((y, i))
        xs.append((x, i))

    ys.sort()
    yd = defaultdict(set)
    yd2 = defaultdict(set)
    old = set()
    for y, i in ys:
        yd2[y] = old.copy()
        old.add(i)
        yd[y] = old.copy()

    xs.sort()
    xd = defaultdict(set)
    xd2 = defaultdict(set)
    old = set()
    for x, i in xs:
        xd2[x] = old.copy()
        old.add(i)
        xd[x] = old.copy()

    ans = INF

    # print(yd)
    # print(xd)
    #
    # print(ok(1, 4, 1, 8, yd, yd2, xd, xd2, K))
    for i, j in combinations(range(N), 2):
        for k, l in combinations(range(N), 2):
            a, b, c, d = ys[i], ys[j], xs[k], xs[l]
            y1 = min([a[0], b[0]])
            y2 = max([a[0], b[0]])

            x1 = min([c[0], d[0]])
            x2 = max([c[0], d[0]])

            # print(i, j)
            # print(x1, x2, abs(x1 - x2))
            # print(y1, y2, abs(y1 - y2))
            # print(ok(y1, y2, x1, x2, yd, yd2, xd, xd2, K))
            if ok(y1, y2, x1, x2, yd, yd2, xd, xd2, K):
                ans = min(ans, abs(x1 - x2) * abs(y1 - y2))

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def main():
    A, B, C = map(int, input().split())
    if A == B:
        print(C)
    elif A == C:
        print(B)
    elif B == C:
        print(A)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, gcd
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


def main():
    N = int(input())
    T = []
    for _ in range(N):
        T.append(int(input()))

    ans = 1
    for t in T:
        ans = lcm(ans, t)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a // g * b


def main():
    N = int(input())
    t_list = list(sorted([int(input()) for _ in range(N)]))
    ans = 1
    for t in t_list:
        ans = lcm(ans, t)

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


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

    a_list = [1] * (2 * 10 ** 5)
    ans = []
    for i in range(1, len(a_list), 2):
        ans.append(a_list[i])
    ans = ans[::-1]
    for i in range(0, len(a_list), 2):
        ans.append(a_list[i])

    if n % 2 != 0:
        ans = ans[::-1]
    print(*ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    a = list(map(int, input().split()))
    print(sum(a) - max(a))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def comb(n,k,p):
    from math import factorial
    if n<0 or k<0 or n<k: return 0
    if n==0 or k==0: return 1
    a=factorial(n) %p
    b=factorial(k) %p
    c=factorial(n-k) %p
    return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p


def power_func(a,b,p):
    """a^b mod p を求める"""
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
        return d*d %p
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p


def main():
    N = int(input())
    A = list(map(int, input().split()))
    MOD = 10 ** 9 + 7

    pos = [-1] * 100010
    for i, a in enumerate(A):
        if pos[a] != -1:
            pos1, pos2 = min(pos[a], i), max(pos[a], i)
            break
        pos[a] = i

    dist = pos2 - pos1
    for i in range(1, N + 2):
        ans = comb(N + 1, i, MOD)
        if i <= dist:
            ans -= comb(N + 1 - dist - 1, i - 1, MOD)

        print(ans % MOD)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, combinations
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right

INF = 10 ** 10


class Combination:
    def __init__(self, n, mod):
        assert 0 < n
        self.mod = mod
        self.fact = [1] * (n + 1)
        self.inv = [1] * (n + 1)
        for i in range(1, len(self.fact)):
            self.fact[i] = (i * self.fact[i - 1]) % self.mod
            self.inv[i] = pow(self.fact[i], self.mod - 2, self.mod)

    def nCr(self, n, k):
        assert 0 < n < len(self.fact) and 0 <= k, (n, k)
        a = self.fact[n]
        b = (self.inv[k] * self.inv[n - k]) % self.mod
        return a * b % self.mod


def main():
    MOD = 10 ** 9 + 7
    n = int(input())
    a_list = list(map(int, input().split()))

    dual = Counter(a_list).most_common(1)[0][0]
    pre, post = [i for i, a in enumerate(a_list) if a == dual]
    x = pre + (n - post)

    comb = Combination(10 ** 5 + 1, MOD)
    for i in range(1, n + 2):
        a, b = comb.nCr(n + 1, i), 0
        if i == 1:
            b = 1
        elif 0 < x and i - 1 <= x:
            b = comb.nCr(x, i - 1)
        print((a - b) % MOD)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, gcd, factorial
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10
MOD = 10 ** 9 + 7

def main():
    N, M = map(int, input().split())
    diff = abs(N - M)
    if diff > 1:
        print(0)
        return

    ans = 2 if diff == 0 else 1
    for i in range(1, N + 1):
        ans = (ans * i) % MOD
    for i in range(1, M + 1):
        ans = (ans * i) % MOD
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, factorial
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10
MOD = 10 ** 9 + 7

def main():
    N, M = map(int, input().split())
    diff = abs(N - M)
    if diff > 1:
        print(0)
        return

    ans = 2 if diff == 0 else 1
    for i in range(1, N + 1):
        ans = (ans * i) % MOD
    for i in range(1, M + 1):
        ans = (ans * i) % MOD
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


color, depth, graph = [], [], {}
def func(v, d, c):
    if not color[v]:
        color[v] = c
    if depth[v] >= d or d == 0:
        return

    for u in graph[v]:
        func(u, d - 1, c)


def main():
    global color, depth, graph
    N, M = map(int, input().split())
    graph = [[] for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        graph[a].append(b)
        graph[b].append(a)

    Q = int(input())
    q = []
    for _ in range(Q):
        v, d, c = map(int, input().split())
        q.append((v - 1, d, c))

    color = [0] * N
    depth = [0] * N
    for i in range(Q - 1, -1, -1):
        func(q[i][0], q[i][1], q[i][2])
    print(*color, sep="\n")

if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def main():
    N = int(input())
    a_list = list(sorted(list(map(int, input().split()))))
    print(sum([a_list[-i * 2 - 2] for i in range(0, N)]))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


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

    ans = len(set(card_list))

    d = defaultdict(int)
    for card in card_list:
        d[card] += 1

    one, two = 0, 0
    for card, num in d.items():
        if num % 2 == 1:
            one += 1
        else:
            two += 1

    print(ans - two % 2)


if __name__ == '__main__':
    main()


Fixed submission:
x = int(input())
if x < 1200:
    print("ABC")
else:
    print("ARC")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict


def main():
    K, S = map(int, input().split())
    ans = 0
    for x in range(0, K + 1):
        for y in range(0, K + 1):
            for z in range(0, K + 1):
                ans += (x + y + z == S)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict


def main():
    K, S = map(int, input().split())
    ans = 0
    for x in range(0, K + 1):
        for y in range(0, K + 1):
            if 0 <= S - (x + y) <= K:
                ans += 1
    print(ans)


if __name__ == '__main__':
    main()