Buggy python submission (verdict: Runtime Error):
import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)


Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Runtime Error):

import numpy as np
N, x = map(int, input().split())
a = np.array(map(int, input().split()))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)


Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Runtime Error):
def inpl(): return [int(i) for i in input().split()]
import numpy as np
N, x = inpl()
a = np.array(inpl())
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)


Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B  = map(int, input().split())
x = list(map(int, input().split()))
inf = float("INF")
dp = x
for i in range(A):
    for j in range(A):
        dp[i] = min(dp[i],x[j]+B*min(abs(j-i),abs(A-abs(i-j))))
print(sum(dp))



Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B  = map(int, input().split())
x = list(map(int, input().split()))
inf = float("INF")
dp = x
for i in range(A):
    for j in range(A):
        dp[i] = min(dp[i],x[j]+B*min(abs(j-i),abs(A-abs(i-j))))
print(sum(dp))


Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B  = map(int, input().split())
x = list(map(int, input().split()))
inf = float("INF")
dp = x
for i in range(A):
    for j in range(A):
        dp[i] = min(dp[i],x[j]+B*min(abs(j-i),abs(A-abs(i-j))))
print(sum(dp))



Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A, B  = map(int, input().split())
x = list(map(int, input().split()))
inf = float("INF")
dp = [inf]*A
for i in range(A):
    for j in range(A):
        dp[i] = min(dp[i],x[j]+B*min(abs(j-i),abs(A-abs(i-j))))
print(sum(dp))



Fixed submission:
import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)