ZhenlongDai/ACPR huggingface dataset:
Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(a,b,c)
if b<=c:
    d=b
    b=c
    c=d
if a<=b:
    d=a
    a=b
    b=d
if b<=c:
    d=b
    b=c
    c=d
print(a,b,c)

print(10*a+b+c)
    

Failing test case input:
-1 9 8

Expected output:
97


Actual output:
-1 9 8
9 8 -1
97


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if b<=c:
    d=b
    b=c
    c=d
if a<=b:
    d=a
    a=b
    b=d
if b<=c:
    d=b
    b=c
    c=d

print(10*a+b+c)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
L=[a+b,b+c,c+a]
L.sort()
print(L[2])

Failing test case input:
1 2 2

Expected output:
23


Actual output:
4


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
L=[a,b,c]
L.sort()
print(L[2]*10+L[1]+L[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc = list(map(int,input().split()))
abc.sort
print(abc[0] + (abc[1]*10 + abc[2]))


Failing test case input:
-2 1 7

Expected output:
69


Actual output:
15


Fixed submission (verdict: Accepted):
abc = list(map(int,input().split()))
abc.sort()
print(abc[0] + (abc[2]*10 + abc[1]))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = sorted(list(map(str, input().split())))
print(int(a[0]+a[1])+int(a[2]))


Failing test case input:
6 7 9

Expected output:
103


Actual output:
76


Fixed submission (verdict: Accepted):
a = sorted(list(map(str, input().split())))
print(int(a[2]+a[1])+int(a[0]))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
p = sorted(list(map(int, input().split())), reverse = False)
print(p[0] * 10 + p[1] + p[2])

Failing test case input:
2 21 1

Expected output:
213


Actual output:
33


Fixed submission (verdict: Accepted):
p = sorted(list(map(int, input().split())), reverse = True)
print(p[0] * 10 + p[1] + p[2])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int,input().split())
if A>B:
  print(A*10 +B+C)
elif A<B:
  print(A+B*10+C)
else:
  print(A+B*10+C)

Failing test case input:
5 5 8

Expected output:
90


Actual output:
63


Fixed submission (verdict: Accepted):
C,A, B = sorted(map(int,input().split()))
if A>B:
  print(A*10 +B+C)
elif A<B:
  print(A+B*10+C)
else:
  print(A+B*10+C)

Problem: p03250
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c = map(int, input().split())
print(max(a*10 + b + c, a + b*10 + c))

Failing test case input:
2 3 7

Expected output:
75


Actual output:
39


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
print(max(a*10 + b + c, a + b*10 + c, a + b + c*10))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
a.sort()

print(a[0]*10+a[1]+a[2])

Failing test case input:
0 4 -4

Expected output:
36


Actual output:
-36


Fixed submission (verdict: Accepted):
a = list(map(int, input().split()))
a.sort()

print(a[2]*10+a[1]+a[0])
Problem: p03250
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A,B,C=input().split()
ichi=10*A+B+C
two=A+10*B+C
print(max(ichi,two))


Failing test case input:
3 2 -1

Expected output:
31


Actual output:
33333333332-1


Fixed submission (verdict: Accepted):
A,B,C=map(int,input().split())
ichi=10*A+B+C
two=A+10*B+C
three=C*10+A+B
print(max(ichi,two,three))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = sorted(map(int,input().split()))
print(a*10+b+c)

Failing test case input:
0 4 -4

Expected output:
36


Actual output:
-36


Fixed submission (verdict: Accepted):
a,b,c = sorted(map(int,input().split()))
print(c*10+b+a)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=sorted(map(int,input().split()))
print(c*10+b+c)

Failing test case input:
1 2 3

Expected output:
33


Actual output:
35


Fixed submission (verdict: Accepted):
A,B,C=sorted(map(int,input().split()))
print(10*C+B+A)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C = sorted(map(int, input().split()))
print(C*10+B+C)

Failing test case input:
3 4 4

Expected output:
47


Actual output:
48


Fixed submission (verdict: Accepted):
A,B,C = sorted(map(int, input().split()))
print(C*10+B+A)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(map(int, input().split()))
A.sort()
print(A)
print(10 * A[2] + A[0] + A[1])


Failing test case input:
0 3 -4

Expected output:
26


Actual output:
[-4, 0, 3]
26


Fixed submission (verdict: Accepted):
A = list(map(int, input().split()))
A.sort()
print(10 * A[2] + A[0] + A[1])

Problem: p03250
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
print(ls[2]*10+ls[1]*ls[0])

Failing test case input:
9 7 8

Expected output:
105


Actual output:
146


Fixed submission (verdict: Accepted):
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
print(ls[2]*10+ls[1]+ls[0])

Problem: p03250
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B, C = map(int, input().split())

t = sorted([A, B, C])
print(A * 10 + B + C)

Failing test case input:
1 4 8

Expected output:
85


Actual output:
22


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())

t = sorted([A, B, C])
print(t[0] + t[1] + t[2] * 10)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ns = input().split()

def bSort(a):
    for i in range(len(a)):
        for j in range(len(a)-1, i, -1):
            if a[j] < a[j-1]:
                a[j], a[j-1] = a[j-1], a[j]

    return a

Failing test case input:
4 4 8

Expected output:
88


Actual output:

Fixed submission (verdict: Accepted):
def bSort(a):
    for i in range(len(a)):
        for j in range(len(a)-1, i, -1):
            if a[j] < a[j-1]:
                a[j], a[j-1] = a[j-1], a[j]

    return a

ns = input().split()
s = bSort(ns)
print(int(s[2]) * 10 + int(s[1]) + int(s[0]))
Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=list(map(int,input().split()))
print(max(10*a+b+c, a+10*b+c))

Failing test case input:
1 5 8

Expected output:
86


Actual output:
59


Fixed submission (verdict: Accepted):
a,b,c=list(map(int,input().split()))
print(max(10*a+b+c, a+10*b+c, a+b+10*c))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
print(a[0]*10+a[1]+a[2])

Failing test case input:
6 6 0

Expected output:
66


Actual output:
12


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
a.sort()
print(a[2]*10+a[1]+a[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

ABC = list(map(int, input().split()))


ABC.sort()
X = 10 * ABC[0] + ABC[1]
Y = ABC[2]
print(X + Y)


Failing test case input:
1 16 1

Expected output:
162


Actual output:
27


Fixed submission (verdict: Accepted):

ABC = list(map(int, input().split()))


ABC.sort(reverse=True)
X = 10 * ABC[0] + ABC[1]
Y = ABC[2]
print(X + Y)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = sorted( list( map(int, input().split() ) ))
x = int( str(n[0])+str(n[1]) ) + n[2]
print(x)

Failing test case input:
4 4 8

Expected output:
88


Actual output:
52


Fixed submission (verdict: Accepted):
n = sorted( list( map(int, input().split() ) ))[::-1]
x = int( str(n[0])+str(n[1]) ) + n[2]
print(x)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int, input().split())

A=10*a+b+c
B=a+10*b+c
print(max(A,B))

Failing test case input:
6 6 9

Expected output:
102


Actual output:
75


Fixed submission (verdict: Accepted):
a,b,c=map(int, input().split())

A=10*a+b+c
B=a+10*b+c
C=a+b+10*c
print(max(A,B,C))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(map(int, input().split()))
l.sort(reverse=True)
print(sum(l[0:2]) + l[2])

Failing test case input:
1 21 0

Expected output:
211


Actual output:
22


Fixed submission (verdict: Accepted):
l = list(map(int, input().split()))
l.sort(reverse=True)
print(10 * l[0] + l[1] + l[2])

Problem: p03250
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
arr = [int(x) for x in input().split()]
arr.sort()
print(arr[0] * 10 + arr[1] + arr[2])

Failing test case input:
1 16 1

Expected output:
162


Actual output:
27


Fixed submission (verdict: Accepted):
arr = [int(x) for x in input().split()]
arr.sort()
print(arr[2] * 10 + arr[1] + arr[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M = list(map(int, input().split()))
print(M[2]*10+M[1]+M[0])

Failing test case input:
0 5 2

Expected output:
52


Actual output:
25


Fixed submission (verdict: Accepted):
M = list(map(int, input().split()))
M.sort()
print(M[2]*10+M[1]+M[0])
Problem: p03250
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
a,b,c=map(int,input().split())
if a>b>c or a>c>b:
    print(10*a+b+c)
elif c>a>b or c>b>a:
    print(10*c+a+b)
else:
    print(10*b+a+c)

Failing test case input:
2 2 4

Expected output:
44


Actual output:
26


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
if a>=b>=c or a>=c>=b:
    print(10*a+b+c)
elif c>=a>=b or c>=b>=a:
    print(10*c+a+b)
else:
    print(10*b+a+c)

Problem: p03250
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=list(map(int,input().split()))
S.sort()
all=0
all += (S[2]+10*S[0]+S[1])
print(all)


Failing test case input:
2 3 5

Expected output:
55


Actual output:
28


Fixed submission (verdict: Accepted):

S=list(map(int,input().split()))
S.sort()
all=0
all += (S[0]+10*S[2]+S[1])
print(all)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
max(a) * 9 + sum(a)

Failing test case input:
-1 0 2

Expected output:
19


Actual output:

Fixed submission (verdict: Accepted):
a = list(map(int, input().split()))
print(max(a) * 9 + sum(a))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = sorted(map(int,input().split()))
print(a*10+b+c)

Failing test case input:
5 2 2

Expected output:
54


Actual output:
27


Fixed submission (verdict: Accepted):
a,b,c = sorted(map(int,input().split()))
print(c*10+b+a)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ABC = [int(x) for x in input().split()]
ABC.sort()
answer = ABC[0]*10 + sum(ABC[1:])
print(answer)

Failing test case input:
2 21 2

Expected output:
214


Actual output:
43


Fixed submission (verdict: Accepted):
ABC = [int(x) for x in input().split()]
ABC.sort()
answer = ABC[-1]*10 + sum(ABC[:2])
print(answer)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
sorted(a)
print(10*a[2]+a[1]+a[0])

Failing test case input:
2 6 1

Expected output:
63


Actual output:
18


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
a=sorted(a)
print(10*a[2]+a[1]+a[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
print(a[0]*10+a[1]+a[2])

Failing test case input:
1 1 0

Expected output:
11


Actual output:
2


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
a.sort(reverse=True)
print(a[0]*10+a[1]+a[2])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input():
    return sys.stdin.readline()[:-1]

a,b,t = map(int,input().split(' '))
M = max(a,b,t)*10
m = min(a,b,t)
print(min(a,b,t)+max(a,b,t)*10+a+b+t-M-m)

Failing test case input:
1 5 2

Expected output:
53

Actual output:
8


Fixed submission (verdict: Accepted):
import sys
def input():
    return sys.stdin.readline()[:-1]
a,b,t = map(int,input().split(' '))

S = a+b+t
M = max(a,b,t)
print(M*10+(S-M))
Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input().split()
N.sort()
print(N)

Nmax = N[2] + N[1]
print(int(Nmax) + int(N[0]))


Failing test case input:
0 2 -2

Expected output:
18


Actual output:
['-2', '0', '2']
18


Fixed submission (verdict: Accepted):
N = input().split()
N.sort()

Nmax = N[2] + N[1]
print(int(Nmax) + int(N[0]))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

abc = inpl()
abc.sort()

print(abc[2]*9+abc[0]+abc[1])


Failing test case input:
-1 0 2

Expected output:
19


Actual output:
17


Fixed submission (verdict: Accepted):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

abc = inpl()
abc.sort()

print(abc[2]*10+abc[0]+abc[1])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
A=10*a+b+c
B=10*b+c+a
print(max(A,B))

Failing test case input:
2 3 5

Expected output:
55


Actual output:
37


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
A=10*a+b+c
B=10*b+c+a
C=10*c+a+b
print(max(A,B,C))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L=sorted(list(map(int, input().split())))
print(L[2]*L[1]-L[0])

Failing test case input:
3 0 -2

Expected output:
28


Actual output:
2


Fixed submission (verdict: Accepted):
L=sorted(list(map(int, input().split())))
print(int(str(L[2])+str(L[1]))+L[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


a=input().split(" ")
a.sort()
print(int(a[0])*10+int(a[1])+int(a[2]))

Failing test case input:
0 1 -1

Expected output:
9


Actual output:
-9


Fixed submission (verdict: Accepted):


a=input().split(" ")
a.sort()
print(int(a[2])*10+int(a[1])+int(a[0]))

Problem: p03250
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=list(map(int,input().split()))
b=sorted(a)
print(b[2]*10+b[1]-b[0])


Failing test case input:
2 6 7

Expected output:
78


Actual output:
74


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
b=sorted(a)
print(b[2]*10+b[1]+b[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = sorted(map(int, input().split()))
x = a * 10 + b
ans = x + c
print(ans)

Failing test case input:
2 2 4

Expected output:
44


Actual output:
26


Fixed submission (verdict: Accepted):
a,b,c = sorted(map(int, input().split()))
x = c * 10 + b
ans = x + a
print(ans)
Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())

if a >= b & a >= c:
    print(10 * a + b + c)
else:
    if b >= c:
        print(10 * b + a + c)
    else:
        print(10 * c + a + b)


Failing test case input:
0 4 0

Expected output:
40


Actual output:
4


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())

if a >= b and a >= c:
    print(10 * a + b + c)
elif b >= a and b >= c:
    print(10 * b + a + c)
else:
    print(10 * c + a + b)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
print(max(10*a+(b+c),10*b+(a+c),10*c+(a+c)))

Failing test case input:
8 7 8

Expected output:
95


Actual output:
96


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
print(10*max(a,b,c)+a+b+c-max(a,b,c))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = sorted(map(int, input().split()))
print(c*10+b+c)

Failing test case input:
2 6 5

Expected output:
67


Actual output:
71


Fixed submission (verdict: Accepted):
a, b, c = sorted(map(int, input().split()))
print(c*10+b+a)

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
buf=[int(x) for x in input().split()]

buf.sort

print(max(buf)*10+buf[1]+buf[0])

Failing test case input:
-1 9 8

Expected output:
97


Actual output:
98


Fixed submission (verdict: Accepted):
buf=[int(x) for x in input().split()]

buf.sort()

print(max(buf)*10+buf[1]+buf[0])

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=[int(i) for i in input().split()]
num=[a,b,c]
num.sort()
print(num[0]+int(str(num[1])+str(num[2])))

Failing test case input:
-2 0 4

Expected output:
38


Actual output:
2


Fixed submission (verdict: Accepted):
a,b,c=[int(i) for i in input().split()]
num=[a,b,c]
num.sort()
print(num[0]+int(str(num[2])+str(num[1])))

Problem: p03250
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = list(map(int,input().split()))
l.sort
print(int(l[2]*10+l[1]+l[0]))

Failing test case input:
0 1 -1

Expected output:
9


Actual output:
-9


Fixed submission (verdict: Accepted):
l = list(map(int,input().split()))

l.sort()

print(l[2]*10+l[1]+l[0])
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = dict()

if n == 1:
    print(1)
    exit()

for i in range(n):
    for j in range(i+1, n):
        p = xy[j][0] - xy[i][0]
        q = xy[j][1] - xy[i][1]
        if ans.get((p, q)) == None:
            ans[(p, q)] = 1
        else:
            ans[(p, q)] += 1
print(ans)
print(list(ans.values()).count(max(ans.values())))

Failing test case input:
3
-1 4
5 49
20 0

Expected output:
2


Actual output:
{(6, 45): 1, (21, -4): 1, (15, -49): 1}
3


Fixed submission (verdict: Accepted):
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = dict()

if n == 1:
    print(1)
    exit()

for i in range(n):
    for j in range(n):
        if (i == j):
            continue
        p = xy[j][0] - xy[i][0]
        q = xy[j][1] - xy[i][1]
        if ans.get((p, q)) == None:
            ans[(p, q)] = 1
        else:
            ans[(p, q)] += 1

print(n-max(ans.values()))

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools, collections
N = int(input())
XY = [[int(_) for _ in input().split()] for _ in range(N)]
count = collections.defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    x1, y1 = XY[i]
    x2, y2 = XY[j]
    count[abs(x1 - x2) + abs(y1 - y2) * 10**10] += 1
if count:
    print(N - max(count.values()))
else:
    print(1)


Failing test case input:
3
-1 4
5 6
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import itertools, collections
N = int(input())
XY = sorted([[int(_) for _ in input().split()] for _ in range(N)])
count = collections.defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    x1, y1 = XY[i]
    x2, y2 = XY[j]
    count[y2 - y1 + (x2 - x1) * 10**10] += 1
if count:
    print(N - max(count.values()))
else:
    print(1)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int(input())
ball = [[int(i) for i in input().split()] for k in range(N)]
diff = []
if N == 1:
    print(1)
else:
    for i in range(N-1):
        for j in range(i+1, N):
            diff.append((abs(ball[i][n]-ball[j][n]) for n in range(2)))
    k = Counter(diff).most_common()[0][1]
    print(max(1,N-k))


Failing test case input:
3
1 4
4 6
7 8

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
from collections import Counter
N = int(input())
ball = [[int(i) for i in input().split()] for k in range(N)]
ball.sort(key=lambda x: x[1])
ball.sort()
diff = []
if N == 1:
    print(1)
else:
    for i in range(N-1):
        for j in range(i+1, N):
            diff.append([(ball[j][n]-ball[i][n]) for n in range(2)])
    k = Counter(map(tuple, diff)).most_common()[0][1]

    print(max(1,N-k))
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]


if n==1:
    print(1)
else:
    diff=[]
    for i in range(n):
        for j in range(i):
            diff.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

    ans=[]
    
    for p,q in set(diff):
        qxHIKUpy=[]
        for i in range(n):
            qxHIKUpy.append(q*xy[i][0]-p*xy[i][1])
        ans.append(len(set(qxHIKUpy)))
    
    print(min(ans))


Failing test case input:
4
1 1
1 4
2 1
2 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
xy.sort(key=lambda x:(x[0],x[1]))

if n<=2:
    print(1)
else:
    diff=[]
    for i in range(n):
        for j in range(i):
            diff.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

    ans=[]
    
    for p,q in set(diff):
        cnt=n
        for i in range(n):
            for j in range(i):
                if xy[i][0]-xy[j][0]==p and xy[i][1]-xy[j][1]==q:
                    cnt-=1
        ans.append(cnt)
    print(min(ans))

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
P=[tuple(map(int,input().split())) for i in range(N)]
ans=N-1
for i in range(N):
    for j in range(N):
        if i==j:
            continue
        p=P[i][0]-P[j][0]
        q=P[i][1]-P[j][1]
        if p==0 or q==0:
            continue
        cost=0
        for k in range(N):
            if (P[k][0]-p,P[k][1]-q) not in P:
                cost+=1
        ans=min(ans,cost)
print(ans)

Failing test case input:
4
1 1
1 2
2 1
2 2

Expected output:
2

Actual output:
3


Fixed submission (verdict: Accepted):
N=int(input())
P=[tuple(map(int,input().split())) for i in range(N)]
ans=N
for i in range(N):
    for j in range(N):
        if i==j:
            continue
        p=P[i][0]-P[j][0]
        q=P[i][1]-P[j][1]
        cost=0
        for k in range(N):
            if (P[k][0]-p,P[k][1]-q) not in P:
                cost+=1
        ans=min(ans,cost)
print(ans)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(0)
	exit()
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = abs(x1- x2)
		rz2 = abs(y1 - y2)
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))

Failing test case input:
3
-1 4
5 10
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = []
for i in range(n):
	x, y = map(int, input().split())
	a.append((x, y))
d = {}
if n == 1:
	print(1)
	exit()
a = sorted(a)
for i in range(n):
	tc = a[i]
	for j in range(i + 1, n):
		nd = a[j]
		x1, y1, = tc[0], tc[1]
		x2, y2, = nd[0], nd[1]
		rz1 = x1 - x2
		rz2 = y1 - y2
		d[(rz1, rz2)] = d.get((rz1,rz2), 0) + 1
print(n - max(d.values()))
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import combinations
n = int(input())
pos = []
for i in range(n):
  pos.append(tuple(map(int,input().split())))
ans = 1e100
def cost(p,q):
  ret = 0
  for i,j in pos:
    ret += 1 - ((i+p,j+q) in pos)
  return ret
for a,b in combinations(pos, 2):
  ans = max(ans, cost(a[0]-b[0],a[1]-b[1]))
print(ans)


Failing test case input:
3
-2 5
4 6
11 3

Expected output:
2


Actual output:
1e+100


Fixed submission (verdict: Accepted):
from itertools import combinations
n = int(input())
if n == 1:
  print(1)
  exit(0)
pos = []
for i in range(n):
  pos.append(tuple(map(int,input().split())))
ans = 1e100
def cost(p,q):
  ret = 0
  for i,j in pos:
    ret += 1 - ((i+p,j+q) in pos)
  return ret
for a,b in combinations(pos, 2):
  ans = min(ans, cost(a[0]-b[0],a[1]-b[1]))
print(ans)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import combinations
from collections import Counter


def main():
    n = int(input())
    if n == 1:
        print(1)

    XY = [list(map(int, input().split())) for _ in range(n)]
    d = []
    for A, B in combinations(XY, 2):
        x1, y1 = A[0], A[1]
        x2, y2 = B[0], B[1]
        p, q = x2 - x1, y2 - y1
        d.append((p, q))
        d.append((-p, -q))

    
    

    C = Counter(d)
    ans = 0
    for v in C.values():
        ans = max(ans, v)
    print(ans)

if __name__ == "__main__":
    main()


Failing test case input:
3
-2 4
4 6
11 3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
from itertools import combinations
from collections import Counter


def main():
    n = int(input())
    if n == 1:
        print(1)
        exit()

    XY = [list(map(int, input().split())) for _ in range(n)]
    d = []
    for A, B in combinations(XY, 2):
        x1, y1 = A[0], A[1]
        x2, y2 = B[0], B[1]
        p, q = x2 - x1, y2 - y1
        d.append((p, q))
        d.append((-p, -q))
    
    

    C = Counter(d)
    ans = 0
    for v in C.values():
        ans = max(ans, v)
    print(n - ans)


if __name__ == "__main__":
    main()

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import combinations


n = int(input())

xys = [list(map(int, input().split())) for _ in range(n)]

min_cost = n
for xyi, xyj in combinations(xys, 2):
    xi, yi = xyi
    xj, yj = xyj
    p = xj - xi
    q = yj - yi

    line_set = set()
    for x, y in xys:
        line_set.add(q * x - p * y)
    cost = len(line_set)
    min_cost = min(min_cost, cost)

print(min_cost)


Failing test case input:
4
1 1
1 4
2 1
2 2

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
from itertools import permutations


n = int(input())
xys = [list(map(int, input().split())) for _ in range(n)]

min_cost = n
for xyi, xyj in permutations(xys, 2):
    xi, yi = xyi
    xj, yj = xyj
    p = xj - xi
    q = yj - yi

    cost = n
    for x, y in xys:
        for xx, yy in xys:
            if x == xx - p and y == yy - q:
                cost -= 1
    min_cost = min(min_cost, cost)

print(min_cost)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
XY = sorted([list(map(int,input().split())) for _ in range(N)])

PQ = []

for i in range(N):
    prev = XY[i]
    for j in range(N):
        if i==j: continue
        next = XY[j]
        p = next[0] - prev[0]
        q = next[1] - prev[1]
        PQ.append([p,q])

ans = 0
for pq in PQ:
    ans = max(ans, N-PQ.count(pq)-1)
print(ans)

Failing test case input:
3
0 7
10 33
24 0

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
XY = sorted([list(map(int,input().split())) for _ in range(N)])

PQ = []

for i in range(N):
    prev = XY[i]
    for j in range(N):
        if i!=j:
            next = XY[j]
            p = next[0] - prev[0]
            q = next[1] - prev[1]
            PQ.append((p,q))

ans = 1
for pq in PQ:
    ans = max(ans, PQ.count(pq))
print(N - ans if N>1 else 1)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]

li = {}
for i in range(N-1):
    for j in range(i,N):
        x1,y1 = XY[i][0],XY[i][1]
        x2,y2 = XY[j][0],XY[j][1]

        PQ = (x2-x1, y2-y1)

        if PQ in li:
            li[PQ] += 1
        else:
            li[PQ] = 1

mm = 0
for i in li:
    mm = max(mm,li[i])
print(N-mm)


Failing test case input:
3
-1 7
9 34
24 -1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]

li = {}
for i in range(N):
    for j in range(N):
        if i==j:
            continue

        x1,y1 = XY[i][0],XY[i][1]
        x2,y2 = XY[j][0],XY[j][1]

        mm1 = x2-x1
        mm2 = y2-y1
        
        
        
        PQ = (mm1, mm2)

        if PQ in li:
            li[PQ] += 1
        else:
            li[PQ] = 1

mm = 0
for i in li:
    mm = max(mm,li[i])
print(N-mm)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = []
l2 = []

for i in range(n):
    x, y = list(map(int, input().split()))
    l.append([x,y])

for i in range(len(l)):
    for j in range(i+1, len(l)):
        dif1 = l[i][0] - l[j][0]
        dif2 = l[i][1] - l[j][1]
        if dif1 != 0 and dif2 != 0:
            l2.append(str(dif1) + ' ' + str(dif2))

try:
    cnt = l2.count(max(l2, key=l2.count))
except:
    cnt = 0
    
print(n - cnt)



Failing test case input:
2
2 1
2 2

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
l = []
l2 = []

for i in range(n):
    a, b = list(map(int, input().split()))
    l.append([a,b])
l.sort()

for i in range(len(l)-1):
    for j in range(i+1, len(l)):
        dif1 = l[i][0] - l[j][0]
        dif2 = l[i][1] - l[j][1]
        l2.append(str(dif1) + ' ' + str(dif2))


try:
    cnt = max(l2, key=l2.count)
except:
    cnt = "1000000 1000000"
x, y = list(map(int, cnt.split()))

ans = 0

for i in range(len(l)):
    if [l[i][0] + x, l[i][1] + y] in l:
        ans += 1

print(n - ans)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools, collections
N = int(input())
XY = sorted([[int(_) for _ in input().split()] for _ in range(N)])
count = collections.defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    x1, y1 = XY[i]
    x2, y2 = XY[j]
    print(i, j, XY[i], XY[j])
    count[y2 - y1 + (x2 - x1) * 10**10] += 1
if count:
    print(N - max(count.values()))
else:
    print(1)


Failing test case input:
3
0 7
9 33
24 -1

Expected output:
2


Actual output:
0 1 [0, 7] [9, 33]
0 2 [0, 7] [24, -1]
1 2 [9, 33] [24, -1]
2


Fixed submission (verdict: Accepted):
import itertools, collections
N = int(input())
XY = sorted([[int(_) for _ in input().split()] for _ in range(N)])
count = collections.defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    x1, y1 = XY[i]
    x2, y2 = XY[j]
    count[y2 - y1 + (x2 - x1) * 10**10] += 1
if count:
    print(N - max(count.values()))
else:
    print(1)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
n=int(input())
ball=[]
for i in range(n):
    ball.append([int(i) for i in input().split()])


pq_cand=set()
for v in itertools.combinations(ball,2):
    xdiff=abs(v[0][0]-v[1][0])
    ydiff=abs(v[0][1]-v[1][1])
    pq_cand.add((xdiff,ydiff))
    
connect=0
for pq in pq_cand:
    con=0
    for point in ball:
        if [point[0]-pq[0],point[1]-pq[1]] in ball:
            con+=1
    connect=max(connect,con)
print(n-connect)

Failing test case input:
3
1 1
0 17
6 0

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import itertools
n=int(input())
ball=[]
for i in range(n):
    ball.append([int(i) for i in input().split()])

ball.sort()


pq_cand=set()
for v in itertools.combinations(ball,2):
    xdiff=v[0][0]-v[1][0]
    ydiff=v[0][1]-v[1][1]
    pq_cand.add((xdiff,ydiff))
    
connect=0
for pq in pq_cand:
    con=0
    for point in ball:
        if [point[0]+pq[0],point[1]+pq[1]] in ball:
            con+=1
    connect=max(connect,con)
print(n-connect)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]

count={}
ans=0
for i in range(n):
    for j in range(i+1,n):
        x=xy[i][0]-xy[j][0]
        y=xy[i][1]-xy[j][1]
        if (x,y) in count:
            count[(x,y)]+-1
        else:
            count[(x,y)]=1

for v in count.values():
    ans=max(ans,v)
print(n-ans)

Failing test case input:
4
1 1
1 2
2 1
2 2

Expected output:
2

Actual output:
3


Fixed submission (verdict: Accepted):
import collections
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
xy.sort()
count={}
ans=0
for i in range(n):
    for j in range(i+1,n):
   
        x=xy[i][0]-xy[j][0]
        y=xy[i][1]-xy[j][1]
        if (x,y) in count:
            count[x,y]+=1
        else:
            count[x,y]=1

for v in count.values():
    ans=max(ans,v)
print(n-ans)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def most_common(d_list):
    items = list(set(d_list))
    s = 0
    for item in items:
        c = d_list.count(item) - 1
        if c > s:
            s = c
    return s

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
d_list = [(XY[0] - xy[j][0], XY[1] - xy[j][1]) for i, XY in enumerate(xy) for j in range(i + 1, N)]
print(N - most_common(d_list))

Failing test case input:
3
-1 4
5 32
10 3

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
if N == 1:
    print(1)
else:
    d_list = [(i[0] - j[0], i[1] - j[1]) for i in xy for j in xy if i != j]
    items = list(set(d_list))
    s = 1
    for item in items:
        c = d_list.count(item)
        if c > s:
            s = c
    print(N - s)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
balls = []
for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append((x,y))

if N == 1:
    print("1")
    exit()

dic = {}
for i in range(N):
    for j in range(N-(i+1)):
        dx = balls[j][0] - balls[i][0]
        dy = balls[j][1] - balls[i][1]
        if (0>dx):
            dx *= -1
            dy *= -1
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1

d_max = max(dic.values())
print(N - d_max)



Failing test case input:
3
-1 7
9 34
24 -1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())
balls = []
for i in range(N):
    x, y = map(int, input().split(' '))
    balls.append((x,y))

if N == 1:
    print("1")
    exit()

dic = {}
for i in range(N):
    for j in range(i+1,N):
        dx = balls[j][0] - balls[i][0]
        dy = balls[j][1] - balls[i][1]
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1
        dx *= -1
        dy *= -1
        if (dx,dy) not in dic.keys():
            dic[(dx,dy)] = 1
        else:
            dic[(dx,dy)] += 1

d_max = max(dic.values())
print(N - d_max)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
xy = []
for _ in range(n):
    x, y = map(int, input().split())
    xy.append((x, y))
dxdy = {}
for i in range(n-1):
    for j in range(i+1, n):
        dx = xy[i][0] - xy[j][0]
        dy = xy[i][1] - xy[j][1]
        if dx<0:
            dx, dy = -dx, -dy
        if (dx, dy) in dxdy:
            dxdy[(dx, dy)] += 1
        else:
            dxdy[(dx, dy)] = 1


Failing test case input:
3
-1 4
9 32
24 0

Expected output:
2


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
xy = []
for _ in range(n):
    x, y = map(int, input().split())
    xy.append((x, y))
dxdy = {}
if n==1:
    print(1)
    exit()
for i in range(n-1):
    for j in range(i+1, n):
        dx = xy[i][0] - xy[j][0]
        dy = xy[i][1] - xy[j][1]
        if dx<0:
            dx, dy = -dx, -dy
        elif dx==0:
            dx, dy = dx, abs(dy)
        if (dx, dy) in dxdy:
            dxdy[(dx, dy)] += 1
        else:
            dxdy[(dx, dy)] = 1
print(n-max(dxdy.values()))

Problem: p03006
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
x=[]
y=[]
if N==1:
    print(1)
for i in range(N):
    X,Y=map(int,input().split())
    x.append(X)
    y.append(Y)
c=[]
for i in range(N):
    for j in range(i+1,N):
        c.append((x[i]-x[j],y[i]-y[j]))
        c.append((x[j]-x[i],y[j]-y[i]))
ans=100
for p,q in c:
    s=0
    for i in range(N):
        if (x[i]-p in x) and (y[i]-q in y):
            pass
        else:
            s+=1
    ans=min(ans,s)
print(ans)


Failing test case input:
3
1 1
1 32
6 1

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
x=[]
y=[]
if N==1:
    print(1)
    quit()
xy=[]
for i in range(N):
    X,Y=map(int,input().split())
    x.append(X)
    y.append(Y)
    xy.append((X,Y))
c=[]
for i in range(N):
    for j in range(i+1,N):
        c.append((x[i]-x[j],y[i]-y[j]))
        c.append((x[j]-x[i],y[j]-y[i]))
ans=100
for p,q in c:
    s=0
    for i in range(N):
        if (x[i]-p,y[i]-q) in xy:
            pass
        else:
            s+=1
    ans=min(ans,s)
print(ans)
Problem: p03006
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from fractions import Fraction
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

if N<=2:
    print(1)
    exit()


def calc(p,q):
    result = set()
    for x,y in XY:
        result.add(y*p - x * q)
    
    return len(result)

ans = 5000

for i in range(N-1):
    for j in range(i,N):
        p = XY[i][0] - XY[j][0]
        q = XY[i][1] - XY[j][1]
        ans = min(ans,calc(p,q))

if ans == 5000:
    raise ValueError
print(ans)

Failing test case input:
3
-1 4
9 44
20 0

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
from fractions import Fraction
from collections import defaultdict
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]

if N<=2:
    print(1)
    exit()


def calc(p,q):
    result = defaultdict(set)
    for x,y in XY:
        result[x].add(y)

    count = 0
    for x in result.keys():
        for y in result[x]:
            if x-p in result and y-q in result[x-p]:
                continue
            count +=1

    return count


ans = 5000

for i in range(N-1):
    for j in range(i+1,N):
        p = XY[i][0] - XY[j][0]
        q = XY[i][1] - XY[j][1]
        
        ans = min(ans,calc(p,q))

if ans == 5000:
    raise ValueError
print(ans)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
import itertools
N = int(input())
balls =[list(map(int, input().split())) for _ in range(N)]
pq = collections.defaultdict(int)
for a, b in itertools.combinations(balls, 2):
    x1, y1 = a
    x2, y2 = b
    p = abs(x1-x2)
    q = abs(y1-y2)
    pq[(p, q)] += 1
cnt = 0
for c in pq.values():
    if c > cnt:
        cnt = c
ans = N-cnt
print(ans)

Failing test case input:
3
-1 4
5 10
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import collections
import itertools
N = int(input())
balls =[list(map(int, input().split())) for _ in range(N)]
pq = collections.defaultdict(int)
for a, b in itertools.combinations(balls, 2):
    x1, y1 = a
    x2, y2 = b
    p = x1-x2
    q = y1-y2
    pq[(p, q)] += 1
    pq[(-p, -q)] += 1
cnt = 0
for c in pq.values():
    if c > cnt:
        cnt = c
ans = N-cnt
print(ans)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
xy=[list(map(int,input().split())) for _ in range(N)]

from collections import Counter
list_=[]

for i in range(N):
    for j in range(i+1,N):
        if xy[i][0]-xy[j][0]<0:
            list_.append((abs(xy[i][0]-xy[j][0]),abs(xy[i][1]-xy[j][1])))
        else:
            list_.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

if N==1:
    print(1)
else:
    print(N-Counter(list_).most_common()[0][1])

Failing test case input:
3
-1 4
5 10
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
xy=[list(map(int,input().split())) for _ in range(N)]

from collections import Counter
list_=[]

for i in range(N):
    for j in range(i+1,N):
        if xy[i][0]-xy[j][0]==0:
            list_.append(((xy[i][0]-xy[j][0]),abs(xy[i][1]-xy[j][1])))
        elif xy[i][0]-xy[j][0]<0:
            list_.append((-(xy[i][0]-xy[j][0]),-(xy[i][1]-xy[j][1])))
        else:
            list_.append((xy[i][0]-xy[j][0],xy[i][1]-xy[j][1]))

if N==1:
    print(1)
else:
    print(N-Counter(list_).most_common()[0][1])

Problem: p03006
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
XYs = [list(map(int, input().split())) for _ in range(N)]

dic = {}
tmp = 0

for i in range(N):
  for j in range(N):
    if i == j:
      continue
    p = XYs[j][0] - XYs[i][0]
    q = XYs[j][1] - XYs[i][1]

    if "{}_{}".format(p,q) not in dic:
      dic["{}_{}".format(p,q)] = 1
    else:
      dic["{}_{}".format(p,q)] += 1
      
for k in dic:
  if tmp < dic[k]:
    tmp = dic[k]

print(dic)
print(N-tmp)

Failing test case input:
3
1 0
5 16
10 4

Expected output:
2


Actual output:
{'4_16': 1, '9_4': 1, '-4_-16': 1, '5_-12': 1, '-9_-4': 1, '-5_12': 1}
2


Fixed submission (verdict: Accepted):
N = int(input())
XYs = [list(map(int, input().split())) for _ in range(N)]

dic = {}
tmp = 0

for i in range(N):
  for j in range(N):
    if i == j:
      continue
    p = XYs[j][0] - XYs[i][0]
    q = XYs[j][1] - XYs[i][1]

    if "{}_{}".format(p,q) not in dic:
      dic["{}_{}".format(p,q)] = 1
    else:
      dic["{}_{}".format(p,q)] += 1
      
for k in dic:
  if tmp < dic[k]:
    tmp = dic[k]

print(N-tmp)

Problem: p03006
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict

n=int(input())
if n==1:
    print(1)
    exit()
c=[]
for _ in range(n): c.append(list(map(int,input().split())))
dic=defaultdict(int)
for i in range(0,n-1):
    for j in range(i+1,n):
        temp=(abs(c[i][0]-c[j][0]),abs(c[i][1]-c[j][1]))
        dic[temp]+=1
print(n-max(dic.values()))

Failing test case input:
3
-1 4
5 6
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
from collections import defaultdict
n=int(input())
c=[]
for _ in range(n): c.append(list(map(int,input().split())))
dic=defaultdict(int)
for i in range(n):
    for j in range(n):
        if i==j: continue
        dic[(c[i][0]-c[j][0],c[i][1]-c[j][1])]+=1
if dict(dic): print(n-max(dic.values()))
else: print(1)
Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
li = []
for i in range(n):
    a = list(map(int,input().split()))
    li.append(a)

li.sort(key = lambda x:x[0])
li2 = []

for i in range(n):
    for j in range(i):
        a = [li[i][0]-li[j][0],li[i][1]-li[j][1]]
        li2.append(a)

for i in li2:
    if i[0] < 0:
        i[0] = -i[0]
        i[1] = -i[1]

ans = 0

print(li2)
for i in li2:
    ans = max(ans,li2.count(i))

print(n-ans)


Failing test case input:
3
-2 4
5 6
11 3

Expected output:
2


Actual output:
[[7, 2], [13, -1], [6, -3]]
2


Fixed submission (verdict: Accepted):
n = int(input())
li = []
for i in range(n):
    a = list(map(int,input().split()))
    li.append(a)

li.sort(key = lambda x:x[0])
li2 = []

for i in range(n):
    for j in range(i):
        a = [li[i][0]-li[j][0],li[i][1]-li[j][1]]
        li2.append(a)

for i in li2:
    if i[0] < 0:
        i[0] = -i[0]
        i[1] = -i[1]
    if i[0] == 0 and i[1] < 0:
        i[1] = -i[1]

ans = 0

for i in li2:
    ans = max(ans,li2.count(i))

print(n-ans)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

XY = [list(map(int,input().split())) for _ in range(N)]

x=[]
y=[]

for X,Y in XY:
    x.append(X)
    y.append(Y)
    
l1=[]
c=0
for i in range(N):
    for j in range(N):
        a=x[i]-x[j]
        b=y[i]-y[j]
        
        l1.append(str(a)+"_"+str(b))
        
v=set(l1)
c=[]
for i in v:
    c.append(l1.count(i))


print(N-max(c))


Failing test case input:
3
-1 4
9 32
24 0

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N=int(input())

XY = [list(map(int,input().split())) for _ in range(N)]

x=[]
y=[]

for X,Y in XY:
    x.append(X)
    y.append(Y)
    
l1=[]
c=0
for i in range(N):
    for j in range(N):
        if i==j:
            continue;
        a=x[i]-x[j]
        b=y[i]-y[j]
        
        l1.append(str(a)+"_"+str(b))
        
v=set(l1)
c=[]
for i in v:
    c.append(l1.count(i))


if c==[]:
    print(1)   
else:
    print(N-max(c))

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = list(map(int, input().split()))
d = {0:1}

pos=[]
for x in range(N[0]):
    a = list(map(int, input().split()))
    for y in pos:
        key = (a[0]-y[0])*(10**11)+(a[1]-y[1])
        if key<0:
            key=-key
    pos.append(a)
    
print(N[0]-max(d.values()))

Failing test case input:
3
1 4
4 6
7 8

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N = list(map(int, input().split()))
d = {0:0}

pos=[]
for x in range(N[0]):
    a = list(map(int, input().split()))
    for y in pos:
        key = (a[0]-y[0])*(10**11)+(a[1]-y[1])
        if key<0:
            key=-key
        if key not in d.keys():
            d[key] = 0
        d[key] += 1
    pos.append(a)
    
print(N[0]-max(d.values()))
Problem: p03006
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())

P = []
for _ in range(N):
    x, y = map(int, input().split())
    P.append((x, y))

from collections import defaultdict

if N == 1:
    print(1)
    exit(0)
    
cnt = defaultdict(int)
for pi in range(N):
    for pj in range(pi+1, N):
        if pi == pj:
            continue
        
        dx = abs(P[pi][0] - P[pj][0])

        
        dy = abs(P[pi][1] - P[pj][1])

        cnt[(dx, dy)] += 1

ans = N-max(cnt.values())
print(ans)



Failing test case input:
3
-1 4
5 10
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())

P = []
for _ in range(N):
    x, y = map(int, input().split())
    P.append((x, y))

from collections import defaultdict

if N == 1:
    print(1)
    exit(0)

cnt = defaultdict(int)
for pi in range(N):
    for pj in range(N):
        if pi == pj:
            continue
        
        dx = P[pi][0] - P[pj][0]

        
        dy = P[pi][1] - P[pj][1]

        cnt[(dx, dy)] += 1

ans = N-max(cnt.values())
print(ans)

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools


def main():
  n = int(input())
  p = [tuple(map(int, input().split())) for _ in range(n)]
  c = {}

  if n == 1:
    print(1)
    return

  for i, j in itertools.combinations(range(len(p)), 2):
    d = (abs(p[j][0] - p[i][0]), abs(p[j][1] - p[i][1]))

    if d not in c:
      c[d] = 1
    else:
      c[d] += 1

  print(len(p) - max(c.values()))


if __name__ == '__main__':
  main()


Failing test case input:
3
-1 4
5 10
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import itertools


def main():
  n = int(input())
  p = [tuple(map(int, input().split())) for _ in range(n)]
  c = {}

  if n == 1:
    print(1)
    return

  for i, j in itertools.product(range(len(p)), repeat=2):
    if i == j:
      continue

    d = (p[j][0] - p[i][0], p[j][1] - p[i][1])

    if d not in c:
      c[d] = 1
    else:
      c[d] += 1

  print(len(p) - max(c.values()))


if __name__ == '__main__':
  main()

Problem: p03006
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import Counter

readline = sys.stdin.readline
n = int(readline())
xy = [list(map(int, readline().split())) for _ in range(n)]

d = []
for i in range(n-1):
    for j in range(i+1, n):
        d.append((abs(xy[i][0] - xy[j][0]), abs(xy[i][1] - xy[j][1])))

if n > 1:
    ans = n - max(Counter(d).values())
else:
    ans = 1

print(ans)


Failing test case input:
3
-1 4
5 6
11 4

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
from collections import Counter

readline = sys.stdin.readline
n = int(readline())
xy = [list(map(int, readline().split())) for _ in range(n)]

d = []
for i in range(n-1):
    for j in range(i+1, n):
        p = xy[i][0] - xy[j][0]
        q = xy[i][1] - xy[j][1]
        d.append((p, q))
        d.append((-p, -q))

if n > 1:
    ans = n - max(Counter(d).values())
else:
    ans = 1

print(ans)