Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
odd=0
four=0
for i in range(N):
  if a[i]%4==0:
    four+=1
  elif a[i]%2!=0:
    odd+=1
if four>=odd or four+odd=N:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
odd=0
four=0
for i in range(N):
  if a[i]%4==0:
    four+=1
  elif a[i]%2!=0:
    odd+=1
if four>=odd:
  print("Yes")
else:
  if odd==four+1 and odd+four==N:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    
    pr = [0]*(max(a)+1)
    for num in a:
        pr[num] += 1
    for i in range(2, max(a)+1):
        count = sum(pr[i::i])
        if count == N:
            print("not coprime")
        elif count > 1:
            flag = False
    if flag:
        print("pairwise coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    pr = [0]*(max(a)+1)
    flag = True
    for num in a:
        pr[num] += 1
    for i in range(2, max(a)+1):
        count = sum(pr[i::i])
        if count == N:
            print("not coprime")
            exit()
        elif count > 1:
            flag = False
    if flag:
        print("pairwise coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    
    def factrize(x):
        f = set()
        for i in range(2,int(x**(1/2))+1):
            if x%i == 0:
                f.add(i)
                while x%i == 0:
                    x //= i
        if x != 1:
            f.add(x)
        return f
    
    base = factrize(a[0])
    union = base
    intersection = base
    flag = True
    for num in a[1:]:
        base = factrize(num)
        if len(union) + len(base) != len(union|base):
            flag = False
        intersection = intersection & base
        union = union | base
    
    if flag:
        print("pairwise coprime")
    else:
        if intersection:
            print("not coprime")
        else:
            print("setwise coprime")

if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    a = list(map(int,input().split()))
    pr = [0]*(max(a)+1)
    flag = True
    for num in a:
        pr[num] += 1
    for i in range(2, max(a)+1):
        count = sum(pr[i::i])
        if count == N:
            print("not coprime")
            exit()
        elif count > 1:
            flag = False
    if flag:
        print("pairwise coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e = map(int,input().split())

print(c*60+d-(a*60+b)-e)


Fixed submission:
S = input()
print(S.replace("?","D"))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
input = sys.stdin.buffer.readline

def main():
    N,M = map(int,input().split())
    edge = [[] for _ in range(N)]
    
    for _ in range(M):
        a,b = map(int,input().split())
        a -= 1;b -= 1
        edge[a].append(b)
        edge[b].append(a)
        
    d = [10**10]*N
    d[0] = 0
    bef = [-1]*N
    
    q = deque([0])
    while q:
        now = q.pop()
        for fol in edge[now]:
            if d[fol] > d[now]+1:
                d[fol] = d[now]+1
                bef[fol] = now
                q.append(fol)

    if 10**10 not in d:
        print("Yes")
        for i in range(1,N):
            print(bef[i]+1)
    else:
        print("No")
    
if __name__ == "__main__":
    main()


Fixed submission:
import sys
from collections import deque
input = sys.stdin.buffer.readline

def main():
    N,M = map(int,input().split())
    edge = [[] for _ in range(N)]
    
    for _ in range(M):
        a,b = map(int,input().split())
        a -= 1;b -= 1
        edge[a].append(b)
        edge[b].append(a)
        
    go = [False]*N
    go[0] = True
    bef = [-1]*N
    
    q = deque([0])
    while q:
        now = q.popleft()
        for fol in edge[now]:
            if not go[fol]:
                bef[fol] = now
                go[fol] = True
                q.append(fol)

    if False in go:
        print("No")
    else:
        print("Yes")
        for i in range(1,N):
            print(bef[i]+1)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,M,K = map(int,input().split())
    MOD = 998244353
    
    if M == 1:
        if K == N-1:
            print(1)
        else:
            print(0)
        exit()
    
    fac = [0]*(N+1)
    fac[0],fac[1] = 1,1
    
    for i in range(2,N+1):
        fac[i] = (fac[i-1]*i)%MOD
        
    def comb(x,y):
        return (fac[x]*pow(fac[y],MOD-2,MOD)*pow(fac[x-y],MOD-2,MOD))%MOD
    
    ans = 0
    base = pow(M-1,N-K-1,MOD)
    for i in reversed(range(K+1)):
        ret = comb(N-1,i)*(M*base)
        ans += ret
        ans %= MOD
        base *= (M-1)
    
    print(ans)
    
if __name__ == "__main__":
    main()


Fixed submission:
def main():
    N,M,K = map(int,input().split())
    MOD = 998244353
    
    if M == 1:
        if K == N-1:
            print(1)
        else:
            print(0)
        exit()
    
    fac = [0]*(N+1)
    fac[0],fac[1] = 1,1
    invfac = [0]*(N+1)
    invfac[0],invfac[1] = 1,1
    
    for i in range(2,N+1):
        fac[i] = (fac[i-1]*i)%MOD
        
    invfac[-1] = pow(fac[-1],MOD-2,MOD)
    
    for i in range(N,0,-1):
        invfac[i-1] = (invfac[i]*i)%MOD
    
    def comb(x,y):
        return (fac[x]*invfac[y]*invfac[x-y])%MOD
    
    ans = 0
    base = [1,pow(M-1,N-K-1,MOD)]
    for i in range(K+1):
        base.append((base[-1]*(M-1))%MOD)

    
    for i in range(K+1):
        ret = comb(N-1,i)*(M*base[-i-2])
        ans += ret
    
    print(ans%MOD)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline
import bisect
import copy
from collections import deque

def main():
    N = int(input())
    a = list(map(int,input().split()))
    INF = 10**12
    
    edge = [[] for _ in range(N)]
    for _ in range(N-1):
        u,v = map(int,input().split())
        edge[u-1].append(v-1)
        edge[v-1].append(u-1)
        
    def LIS(dp,num):
        ind = bisect.bisect_left(dp,num)
        ret = dp[ind]
        dp[ind] = num
        return ind,ret
    
    dp = [INF]*(N+2)
    dp[0] = -INF
    dp[1] = a[0]

    ans = [0]*N
    q = deque([])
    
    def DFS(prev,now,dp):
        while q:
            s,t,ind,num = q.pop()
            if t == prev:
                q.append((s,t,ind,num))
                break
            else:
                dp[ind] = num
        ind,num = LIS(dp,a[now])
        ans[now] = ind
        q.append((prev,now,ind,num))
        for fol in edge[now]:
            if fol != prev:
                DFS(now,fol,dp)

    DFS(-1,0,dp)
    print(*ans,sep="\n")
 
if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline
import bisect
import copy
from collections import deque
sys.setrecursionlimit(10**7)

def main():
    N = int(input())
    a = list(map(int,input().split()))
    INF = 10**12
    
    edge = [[] for _ in range(N)]
    for _ in range(N-1):
        u,v = map(int,input().split())
        edge[u-1].append(v-1)
        edge[v-1].append(u-1)
        
    def LIS(dp,num):
        ind = bisect.bisect_left(dp,num)
        ret = dp[ind]
        dp[ind] = num
        return ind,ret
    
    dp = [INF]*(N+2)
    dp[0] = -INF

    ans = [0]*N
    q = deque([])
    
    def DFS(prev,now,dp):
        while q:
            s,t,ind,num = q.pop()
            if t == prev:
                q.append((s,t,ind,num))
                break
            else:
                dp[ind] = num
        ind,num = LIS(dp,a[now])
        ans[now] = max(ind,ans[prev])
        q.append((prev,now,ind,num))
        for fol in edge[now]:
            if fol != prev:
                DFS(now,fol,dp)

    DFS(-1,0,dp)
    print(*ans,sep="\n")
 
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline
from operator import itemgetter
sys.setrecursionlimit(10**7)

def main():
    N = int(input())
    a = list(map(int,input().split()))
    active = []
    
    for i in range(N):
        active.append((a[i],i))
        
    active.sort(key=itemgetter(0),reverse=True)
    
    def point(x,y,ind):
        if ind == N:
            return 0
        else:
            ret1 = point(x+1,y,ind+1)+active[ind][0]*(abs(active[ind][1]-x))
            ret2 = point(x,y-1,ind+1)+active[ind][0]*(abs(active[ind][1]-y))
            ret = max(ret1,ret2)
            return ret
    
    print(point(0,N-1,0))

if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline
from operator import itemgetter

def main():
    N = int(input())
    a = list(map(int,input().split()))
    active = []
    
    for i in range(N):
        active.append((a[i],i))
        
    active.sort(key=itemgetter(0),reverse=True)
    dp = [[0]*(N+1) for _ in range(N+1)]
    
    for i in range(N):
        for j in range(i+1):
            x,y = j,i-j
            dp[x+1][y] = max(dp[x+1][y],dp[x][y]+active[x+y][0]*(abs(active[x+y][1]-x)))
            dp[x][y+1] = max(dp[x][y+1],dp[x][y]+active[x+y][0]*(abs(active[x+y][1]-(N-y-1))))

    ans = 0
    for i in range(N+1):
        ans = max(ans,dp[i][N-i])
        
    print(ans)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
s = sum(a)
vor = -(-s//(4*M))
if a[M-1] >= vor:
    print("Yes")
else:
    print("No")

Fixed submission:
N,K = map(int,input().split())
a = N%K
b = abs(a-K)
print(min(a,b))
Buggy python submission (verdict: Runtime Error):
H,W = map(int,input().split())
    print((H*W)//2+(H*W)%2)


Fixed submission:
import sys
input = sys.stdin.readline

def main():
    H,W = map(int,input().split())
    if H == 1 or W == 1:
        print(1)
    else:
        print((H*W)//2+(H*W)%2)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
#input = sys.stdin.buffer.readline
from collections import deque

def main():
    s = list(input())
    s = deque(s)
    q = int(input())
    for _ in range(q):
        x = list(input().split())
        if x[0] == "1":
            l = len(s)
            for i in range(l//2):
                s[i],s[-i-1] = s[-i-1],s[i]
        else:
            if x[1] == "1":
                s.appendleft(x[2])
            else:
                s.append(x[2])
    
    print("".join(s))

if __name__ == "__main__":
    main()


Fixed submission:
import sys
#input = sys.stdin.buffer.readline
from collections import deque

def main():
    s = list(input())
    s = deque(s)
    q = int(input())
    count,b = 0,1
    for _ in range(q):
        x = list(input().split())
        if x[0] == "1":
            b *= -1
            count += 1
        else:
            if x[1] == "1":
                if b == 1:
                    s.appendleft(x[2])
                else:
                    s.append(x[2])
            else:
                if b == 1:
                    s.append(x[2])
                else:
                    s.appendleft(x[2])
    
    if count%2 != 0:
        s.reverse()
        
    print("".join(s))

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
#input = sys.stdin.buffer.readline
from collections import defaultdict

def main():
    N,P = map(int,input().split())
    S = input()
    
    if 10%P == 0:
        ans = 0
        for i,st in enumerate(S[::-1]):
            num = int(st)
            if num % P == 0:
                ans += N-i
    else:
        ans,base = 0,1
        MOD = 0
        d = defaultdict(int)
        d[0] = 1
        for st in S[::-1]:
            num = int(st)
            MOD = (MOD+num*base)%P
            d[MOD] += 1
            base *= 10
        for v in d.values():
            ans += (v*(v-1))//2
        
    print(ans)

if __name__ == "__main__":
    main()


Fixed submission:
import sys
#input = sys.stdin.buffer.readline
from collections import Counter

def main():
    N,P = map(int,input().split())
    s = input()
    l = len(s)
    ans = 0
    if 10%P == 0:
        for i,st in enumerate(s[::-1]):
            num = int(st)
            if num%P == 0:
                ans += l-i
    else:
        rest = [0]
        t = 1
        for st in s[::-1]:
            num = int(st)%P
            rest.append(num*t%P)
            t = t*10%P
            
        for i in range(l):
            rest[i+1] += rest[i]

        for i in range(l):
            rest[i+1] %= P
            
        c = Counter(rest)
        c = list(c.values())
        for num in c:
            ans += num*(num-1)//2
    
    print(ans)
    
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
#input = sys.stdin.buffer.readline
from collections import defaultdict

def main():
    N,P = map(int,input().split())
    s = input()
    l = len(s)
    ans = 0
    if 10%P == 0:
        for i,st in enumerate(s[::-1]):
            num = int(st)
            if num%P == 0:
                ans += l-i
    else:
        d = defaultdict(int)
        d[0] = 1
        now = ""
        for st in s[::-1]:
            now = st+now
            num = int(now)
            ans += d[num%P]
            d[num%P] += 1
    
    print(ans)
    
if __name__ == "__main__":
    main()


Fixed submission:
import sys
#input = sys.stdin.buffer.readline
from collections import Counter

def main():
    N,P = map(int,input().split())
    s = input()
    l = len(s)
    ans = 0
    if 10%P == 0:
        for i,st in enumerate(s[::-1]):
            num = int(st)
            if num%P == 0:
                ans += l-i
    else:
        rest = [0]
        t = 1
        for st in s[::-1]:
            num = int(st)%P
            rest.append(num*t%P)
            t = t*10%P
            
        for i in range(l):
            rest[i+1] += rest[i]

        for i in range(l):
            rest[i+1] %= P
            
        c = Counter(rest)
        c = list(c.values())
        for num in c:
            ans += num*(num-1)//2
    
    print(ans)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
#input = sys.stdin.buffer.readline
import bisect

def main():
    N = int(input())
    S = list(str(input()))
    
    pos = [[] for _ in range(26)]
    for x,s in enumerate(S):
        num = ord(s)-ord("a")
        pos[num].append(x)
    
    q = int(input())
    for _ in range(q):
        m,a,b = map(str,input().split())
        if m == "1":
            a = int(a)-1
            if S[a] == b:
                continue
            else:
                popind = bisect.bisect_left(pos[ord(S[a])-ord("a")],a)
                pos[ord(S[a])-ord("a")].pop(popind)
                bisect.insort(pos[ord(b)-ord("a")],a)
        else:
            a,b = int(a)-1,int(b)
            count = 0
            for i in range(26):
                aind = bisect.bisect_left(pos[i],a)
                bind = bisect.bisect_left(pos[i],b)
                if bind-aind > 0:
                    count += 1
            print(count)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
#input = sys.stdin.buffer.readline
import bisect

def main():
    N = int(input())
    S = list(str(input()))
    
    pos = [[] for _ in range(26)]
    for x,s in enumerate(S):
        num = ord(s)-ord("a")
        pos[num].append(x)
    
    q = int(input())
    for _ in range(q):
        m,a,b = map(str,input().split())
        if m == "1":
            a = int(a)-1
            if S[a] == b:
                continue
            else:
                popind = bisect.bisect_left(pos[ord(S[a])-ord("a")],a)
                pos[ord(S[a])-ord("a")].pop(popind)
                bisect.insort(pos[ord(b)-ord("a")],a)
                S[a] = b
        else:
            a,b = int(a)-1,int(b)-1
            count = 0
            for i in range(26):
                l = bisect.bisect_left(pos[i],a)
                if l >= len(pos[i]):
                    continue
                if pos[i][l] <= b:
                    count += 1
            print(count)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline
import fractions
from functools import reduce

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    l = reduce(lcm,a)
    ans = 0
    for num in a:
        ans += l//num
        ans %= MOD
    
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
input = sys.stdin.buffer.readline
import fractions
from functools import reduce

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    l = reduce(lcm,a)
    ans = 0
    for num in a:
        ans += l//num
    
    print(ans%MOD)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline
import fractions

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    ans = 0
    l0 = 1
    for num in a:
        l1 = lcm(l0,num)
        ans = (ans*(l1//l0)+l1//num)%MOD
        l0 = l1
        
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
input = sys.stdin.buffer.readline
import fractions
from functools import reduce

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    l = reduce(lcm,a)
    ans = 0
    for num in a:
        ans += l//num
    
    print(ans%MOD)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline
import fractions

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    ans = 0
    l = [1]
    for num in a:
        l.append(lcm(l[-1],num))
        ans = (ans*(l[-1]//l[-2])+l[-1]//num)%MOD
        
    print(ans)

if __name__ == "__main__":
    main()

Fixed submission:
import sys
input = sys.stdin.buffer.readline
import fractions
from functools import reduce

def main():
    N = int(input())
    a = list(map(int,input().split()))
    MOD = 10**9+7
            
    def lcm(x,y):
        return((x*y)//fractions.gcd(x,y))
        
    l = reduce(lcm,a)
    ans = 0
    for num in a:
        ans += l//num
    
    print(ans%MOD)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np

def main():
    N,M = map(int,input().split())
    a = sorted(list(map(int,input().split())))
    b = [0]+a
    a = np.array(a)
    cum = np.cumsum(b)
    
    def power(x,y):
        pos = np.searchsorted(a,x-y)
        count = np.sum(N-pos)
        if count >= M:
            return True
        else:
            return False
    
    l,r = 0,10**5+1
    while r-l > 1:
        mid = (l+r)//2
        if power(mid,a):
            l = mid
        else:
            r = mid

    def solve(x,y,minuse):
        ans = 0
        pos_rev = np.searchsorted(a,x-y)
        pos = N-pos_rev
        count = np.sum(pos)
        ans = np.sum(a*[pos]+cum[-1]-cum[-pos-1])
        return ans-minuse*(count-M)
        
    print(solve(l,a,l))

if __name__ == "__main__":
    main()


Fixed submission:
import numpy as np
 
N,M = map(int,input().split())
A = np.array(input().split(),np.int64)
 
A = np.sort(A)
S = np.zeros(N+1,np.int64)
S[1:]= np.cumsum(A)
 
hi = 200001
lo = -1
 
while hi-lo > 1:
    mid = (hi+lo)//2
    above_mid = (N-np.searchsorted(A,mid-A,side='left')).sum()
    if above_mid >= M:
        lo = mid
    else:
        hi = mid
 
X = np.searchsorted(A,hi-A,side='left')
 
above_hi = (N-X).sum()
happiness = (S[-1]-S[X]).sum()
happiness += (A*(N-X)).sum()
happiness += (M-above_hi)*lo
 
print(happiness)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    if N % 2 == 1:
        print(0)
    else:
        N //= 2
        count = 0
        while N > 1:
            N //= 5
            count += N
            
    print(count)
    
if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    if N % 2 == 1:
        print(0)
    else:
        N //= 2
        count = 0
        while N > 1:
            N //= 5
            count += N
        print(count)
    
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def main():
    N = map(int,input().split())
    a = list(map(int,input().split()))
    MOD = 10**9+7
    M = max(a)
    l = M.bit_length()
    bit = [[0,0] for _ in range(l)]

    for num in a:
        for i in range(l):
            re = num%2
            bit[i][re] += 1
            num //= 2

    ans = 0
    for i in range(l):
        x = (bit[i][0]*bit[i][1])*(1<<i)
        ans += (x%MOD)
    
    print(ans%MOD)    
    
if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline
import numpy as np

def main():
    N = int(input())
    a = np.array(list(map(int,input().split())),dtype = int)
    MOD = 10**9+7
    ans = 0
    for n in range(60):
        bit = (a>>n)&1
        nonzero = np.count_nonzero(bit)
        zero = N-nonzero
        count = nonzero*zero
        for _ in range(n):
            count *= 2
            count %= MOD
        ans += count
        ans %= MOD
    
    print(ans)

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.buffer.readline

def main():
    N = int(input())
    INF = 10**9+7
    A = list(map(int,input().split()))
    M = max(A)
    l = M.bit_length()
    d = [[0,0] for _ in range(l)]
    for i in range(N):
        num = A[i]
        count = 0
        while count != l:
            use = num%2
            d[count][use] += 1
            num //= 2
            count += 1
        
    ans = 0    
    for i in range(l):
        x,y = d[i]
        ans += (x*y)*(2**i)
        ans %= INF
        
    print(ans)

if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.buffer.readline
import numpy as np

def main():
    N = int(input())
    a = np.array(list(map(int,input().split())),dtype = int)
    MOD = 10**9+7
    ans = 0
    for n in range(60):
        bit = (a>>n)&1
        nonzero = np.count_nonzero(bit)
        zero = N-nonzero
        count = nonzero*zero
        for _ in range(n):
            count *= 2
            count %= MOD
        ans += count
        ans %= MOD
    
    print(ans)

if __name__ == "__main__":
    main()