Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

N = I()
C = III()
C.sort()

ans = 0
for i in range(N):
    ans += 4**(N-1)*C[i]*(N-i+1)
    ans %= mod

print(ans)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

N = I()
C = III()
C.sort()

ans = 0
for i in range(N):
    ans += pow(4,N-1,mod)*C[i]*(N-i+1)
    ans %= mod

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[] for _ in range(num)]
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

# FFT
# use python3
# a = np.array([a1,a2,a3]), b= np.array([b1,b2,b3])
# c = np.array([a1b1,a1b2+a2b1,a1a3+a2b2+a3b1,a2b3+a3b2,a3b3])
import numpy as np
def Convolution(a,b):
    bit = (len(a)+len(b)-2).bit_length()
    L = 2**bit
    fa,fb = np.fft.rfft(a,L), np.fft.rfft(b,L)
    c = np.rint(np.fft.irfft(fa*fb,L)).astype(np.int64)
    return c[:len(a)+len(b)-1]

N,M = II()
A = III()

print('time test')

h = [0]*(max(A))
for a in A:
    h[a-1] += 1

conv = np.append([0,0],Convolution(h,h))
ans = 0
count = 0
'''
for k in range(2,2*max(A)+1)[::-1]:
    if conv[k]:
        num = min(M-count,conv[k])
        count += num
        ans += k*num
    if count==M:
        break
'''
print(ans)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

S,T = map(str, input().split())
print(T+S)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

inf = 10**30
N,X,D = II()

if D<0:
    X,D = -X,-D

kukan = []
for i in range(N+1):
    kukan.append([i*X+(i*(i-1)//2)*D, i*X+(N*(N-1)//2-(N-i)*(N-i-1)//2)*D, (i*X)%D])
kukan.sort(key=lambda x:(x[2],x[0]))

div,d_min,d_max = inf,inf,inf
ans = 0
for k in kukan:
    if k[2]!=div:
        if d_min!=inf:
            ans += (d_max-d_min)//D + 1
        d_min,d_max,div = k[0],k[1],k[2]
    else:
        if k[0]>d_max:
            ans += (d_max-d_min)//D + 1
            d_min,d_max = k[0],k[1]
        else:
            d_max = k[1]
ans += (d_max-d_min)//D + 1

print(ans)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

inf = 10**30
N,X,D = II()

if D==0:
    if X==0:
        print(1)
    else:
        print(N+1)
    exit()
if D<0:
    X,D = -X,-D

kukan = []
for i in range(N+1):
    kukan.append([i*X+(i*(i-1)//2)*D, i*X+(N*(N-1)//2-(N-i)*(N-i-1)//2)*D, (i*X)%D])
kukan.sort(key=lambda x:(x[2],x[0]))

div,d_min,d_max = inf,inf,inf
ans = 0
for k in kukan:
    if k[2]!=div:
        if d_min!=inf:
            ans += (d_max-d_min)//D + 1
        d_min,d_max,div = k[0],k[1],k[2]
    else:
        if k[0]>d_max:
            ans += (d_max-d_min)//D + 1
            d_min,d_max = k[0],k[1]
        else:
            d_max = max(d_max,k[1])
ans += (d_max-d_min)//D + 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from bisect import bisect_right

N,M = II()
A = list(map(str, input().split()))

B = list(reversed(A))
ones = []
n = [0]*N
for i in range(N):
    if B[i]=='1':
        ones.append(i)

ans = []
place = 0
while place<N-1:
    for i in range(1,M+1)[::-1]:
        if B[place+i]!=1:
            ans.append(i)
            place += i
        if i==1 and B[place+i]=='1':
            print(-1)
            exit()

print(*list(reversed(ans)))

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from bisect import bisect_right

N,M = II()
A = str(input())

B = A[::-1]

ans = []
place = 0
while place!=N:
    for i in range(1,M+1)[::-1]:
        if place+i<=N:
            if B[place+i]!='1':
                ans.append(i)
                place += i
                break
        if i==1 and B[place+i]=='1':
            print(-1)
            exit()

print(*list(reversed(ans)))
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

a,b,x = II()

h = (x-a**2*b/2)*2/(a**2)
if h>=0:
    r = math.degrees(math.atan(a/(b-h)))
    print(90-r)
else:
    z = 2*x/(a*b)
    r = math.degrees(math.atan(z/b))
    print(90-r)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

a,b,x = II()

h = (x-a**2*b/2)*2/(a**2)
if h>=0:
    if b-h==0:
        print(0)
    else:
        r = math.degrees(math.atan(a/(b-h)))
        print(90-r)
else:
    z = 2*x/(a*b)
    r = math.degrees(math.atan(z/b))
    print(90-r)

Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from decimal import Decimal

a,b,x = II()

h = Decimal((x-a**2*b/2)*2/(a**2))
if h>=0:
    r = math.degrees(math.atan(a/(b-h)))
    print(90-r)
else:
    z = Decimal(2*x/(a*b))
    r = math.degrees(math.atan(z/b))
    print(90-r)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

a,b,x = II()

h = (x-a**2*b/2)*2/(a**2)
if h>=0:
    if b-h==0:
        print(0)
    else:
        r = math.degrees(math.atan(a/(b-h)))
        print(90-r)
else:
    z = 2*x/(a*b)
    r = math.degrees(math.atan(z/b))
    print(90-r)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

S = str(input())
n = len(S)
K = I()

for i in range(1,n):
    if S[i]!=S[i-1]:
        break
    else:
        if i==n-1:
            print(K*n//2)
            exit()

ren = 1
num = 0
for i in range(1,n):
    if S[i]==S[i-1]:
        ren += 1
    else:
        if i!=n-1:
            num += ren//2
            ren = 1

last = ren

if S[0]==S[-1]:
    num2 = 0
    for i in range(n):
        if S[i]==S[-1]:
            ren += 1
        else:
            now = i
            break
    num2 += ren//2
    ren = 1
    for i in range(now,n):
        if S[i]==S[i-1]:
            ren += 1
        else:
            if i!=n-1:
                num2 += ren//2
                ren = 1
    num3 = 0
    ren = 1
    for i in range(n-1-last+2,n):
        if S[i]==S[i-1]:
            ren += 1
        else:
            num3 += ren//2
            ren = 1
    num3 += ren//2
    print(num+num2*(K-1)+num3)
else:
    num += ren//2
    print(num*K)

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

S = str(input())
n = len(S)
K = I()

for i in range(1,n):
    if S[i]!=S[i-1]:
        break
    else:
        if i==n-1:
            print(K*n//2)
            exit()

if n==1:
    print(K//2)
    exit()

ren = 1
num = 0
for i in range(1,n):
    if S[i]==S[i-1]:
        ren += 1
    else:
        if i!=n-1:
            num += ren//2
            ren = 1

last = ren

if S[0]==S[-1]:
    num2 = 0
    for i in range(n):
        if S[i]==S[-1]:
            ren += 1
        else:
            now = i
            break
    num2 += ren//2
    ren = 1
    for i in range(now,n):
        if S[i]==S[i-1]:
            ren += 1
        else:
            if i!=n-1:
                num2 += ren//2
                ren = 1
    num3 = 0
    ren = 1
    for i in range(n-1-last+2,n):
        if S[i]==S[i-1]:
            ren += 1
        else:
            num3 += ren//2
            ren = 1
    num3 += ren//2
    print(num+num2*(K-1)+num3)
else:
    num += ren//2
    print(num*K)
Buggy python submission (verdict: Runtime Error):
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from heapq import heapify, heappop, heappush, heappushpop,\
                  _heapify_max, _siftdown_max, _siftup_max

def _heappush_max(heap, item):
    heap.append(item)
    _siftdown_max(heap, 0, len(heap)-1)

def _heappop_max(heap):
    lastelt = heap.pop()
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        _siftup_max(heap, 0)
        return returnitem
    return lastelt

N = I()
S = III()

S.sort()
A = [[S.pop(),N]]
_heapify_max(A)
while S:
    temp = S.pop()
    a = _heappop_max(A)
    if a[0]<=temp:
        print('No')
        exit()
    else:
        if a[1]>=2:
            _heappush_max(A,[a[0],a[1]-1])
            _heappush_max(A,[temp,a[1]-1])
    
print('Yes')

Fixed submission:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

import heapq
class Reverse:
    def __init__(self, val):
        self.val = val
        
    def __lt__(self, other):
        return self.val > other.val
        
    def __repr__(self):
        return repr(self.val)
    
class Heapq:
    def __init__(self, arr, desc = False):
        if desc:
            for i in range(len(arr)):
                arr[i] = Reverse(arr[i])
        self.desc = desc
        self.hq = arr
        heapq.heapify(self.hq)
 
    def pop(self):
        if self.desc: return heapq.heappop(self.hq).val
        else: return heapq.heappop(self.hq)
 
    def push(self, a):
        if self.desc: heapq.heappush(self.hq, Reverse(a))
        else: heapq.heappush(self.hq, a)
 
    def top(self):
        if self.desc: return self.hq[0].val
        else: return self.hq[0]

N = I()
S = III()

S.sort()
a = [Heapq([],True) for _ in range(N+1)]
count = [0]*(N+1)

s = S.pop()
a[N].push(s)
count[N] = 1

while S:
    flag = False
    temp = S.pop()
    for i in range(1,N+1)[::-1]:
        if count[i]:
            if temp<a[i].top():
                x = a[i].pop()
                count[i] -= 1
                a[i-1].push(x)
                a[i-1].push(temp)
                count[i-1] += 2
                flag = True
                break
    if not flag:
        print('No')
        exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 998244353

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

import statistics
from bisect import bisect_left


def fact(a,M=mod):
    ans = 1
    for i in range(2,a+1):
        ans = ans*i
        ans = ans%M
    return ans

N = I()
S = str(input())

r = []
g = []
b = []

m1 = []
m2 = []
m3 = []

for i in range(3*N):
    if S[i]=='R':
        r.append(i)
    elif S[i]=='G':
        g.append(i)
    else:
        b.append(i)

for i in range(N):
    m1.append(min(r[i],g[i],b[i]))
    m2.append(statistics.median([r[i],g[i],b[i]]))
    m3.append(max(r[i],g[i],b[i]))

ans = fact(N)

for i in range(N):
    left = bisect_left(m1,m2[i])
    ans = ans*(left-i)%mod

for i in range(N)[::-1]:
    right = N-bisect_left(m3,m2[i])
    ans = ans*(right-(N-1-i))%mod

print(ans)

Fixed submission:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 998244353

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

from bisect import bisect_left


def fact(a,M=mod):
    ans = 1
    for i in range(2,a+1):
        ans = ans*i
        ans = ans%M
    return ans

N = I()
S = str(input())

r = []
g = []
b = []

m1 = []
m2 = []
m3 = []

for i in range(3*N):
    if S[i]=='R':
        r.append(i)
    elif S[i]=='G':
        g.append(i)
    else:
        b.append(i)

for i in range(N):
    m1.append(min(r[i],g[i],b[i]))
    m2.append(sorted([r[i],g[i],b[i]])[1])
    m3.append(max(r[i],g[i],b[i]))

ans = fact(N)

for i in range(N):
    left = bisect_left(m1,m2[i])
    ans = ans*(left-i)%mod

for i in range(N)[::-1]:
    right = N-bisect_left(m3,m2[i])
    ans = ans*(right-(N-1-i))%mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

#互いに素なa,bについて、a*x+b*y=1の一つの解[x,y]を出力
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    return [w[0],w[1]]

# aの逆元(mod M)を求める（aとMは互いに素であることが前提）
def mod_inv(a,M=mod):
    x = extgcd(a,M)[0]
    return (M+x%M)%M

#a!をmodしつつ求める
def fact(a,M=mod):
    ans = 1
    for i in range(2,a+1):
        ans = ans*i
        ans = ans%M
    return ans


p = I()
a = III()

beki = [[0]*p for _ in range(p)]
for i in range(p):
    for j in range(p):
        beki[i][j] = pow(-i, j, p)

fact_inv = [0]*p
for i in range(p):
    fact_inv[i] = mod_inv(fact(i,p),p)

pfact = fact(p-1,p)

ans = [0]*p
for j in range(p):
    if a[j]==0:
        continue
    else:
        ans[0] += 1
        for i in range(p):
            ans[i] -= pfact*fact_inv[i]*fact_inv[p-1-i]*beki[j][p-1-i]
            ans[i] %= p

print(*ans)

Fixed submission:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

#互いに素なa,bについて、a*x+b*y=1の一つの解[x,y]を出力
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    return [w[0],w[1]]

# aの逆元(mod M)を求める（aとMは互いに素であることが前提）
def mod_inv(a,M=mod):
    x = extgcd(a,M)[0]
    return (M+x%M)%M

#a!をmodしつつ求める
def fact(a,M=mod):
    ans = 1
    for i in range(2,a+1):
        ans = ans*i
        ans = ans%M
    return ans


p = I()
a = III()

beki = [[1]*p for _ in range(p)]
for i in range(p):
    for j in range(1,p):
        beki[i][j] = beki[i][j-1]*(-i)
        beki[i][j] = beki[i][j]%p

fact_inv = [0]*p
for i in range(p):
    fact_inv[i] = mod_inv(fact(i,p),p)

pfact = fact(p-1,p)

ans = [0]*p
for j in range(p):
    if a[j]==0:
        continue
    else:
        ans[0] += 1
        for i in range(p):
            ans[i] -= pfact*fact_inv[i]*fact_inv[p-1-i]*beki[j][p-1-i]
            ans[i] %= p

print(*ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N=int(input())
x=[0]*N
y=[0]*N
for i in range(N):
  x[i],y[i] = map(int, input().split())
a = []
for i in range(N):
  for j in range(i+1,N):
    a.append(str(x[j]-x[i])+'&'+str(y[j]-y[i]))
    
a=Counter(a)
common = a.most_common(1)[0][1]
print(N-common)

Fixed submission:
import sys
from collections import Counter

N=int(input())
if N==1:
  print(1)
  sys.exit()
  
x=[0]*N
y=[0]*N
for i in range(N):
  x[i],y[i] = map(int, input().split())
a = []
for i in range(N):
  for j in range(N):
    if i==j:
      continue
    else:
      a.append(str(x[j]-x[i])+'&'+str(y[j]-y[i]))
    
a=Counter(a)
common = a.most_common(1)[0][1]
print(N-common)
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from decimal import *
L,A,B,M=map(int, input().split())

def matpow(X,n,mod):
  E = np.eye(N=X.shape[0],dtype=int)
  Y = X%mod
  if n == 1:
    return Y
  else:
    return np.dot(matpow(np.dot(Y,Y)%mod,n//2,mod), (Y if n % 2 else E))%mod
  
a = 0
for d in range(1,19):
  left = math.ceil(Decimal(10**(d-1)-A)/Decimal(B))
  right = math.ceil(Decimal(10**d-A)/Decimal(B))-1
  if right < 0:
    continue
  if left > L-1:
    break
  if left > right:
    continue
  if left < 0:
    left = 0
  if right > L-1:
    right = L-1
  mat = np.matrix([[10**d,0,0],[1,1,0],[0,1,1]])
  result = np.dot(np.array([a,A+B*left,B])%M, matpow(mat,right-left+1,M))
  a = result[0,0]%M
  
print(a)

Fixed submission:
p,q,r=map(int, input().split()) 
x = max(p,q,r)
print(p+q+r-x)