fork download
  1. import io, os
  2. input=(io.BytesIO(os.read(0, os.fstat(0).st_size)).readline)
  3. plist=[]
  4. n=int(input())
  5. for i in range(n):
  6. x,y=[int(s) for s in input().split()]
  7. plist.append((x,y))
  8. plist.sort()
  9. count=0
  10. while plist:
  11. x1,y1=plist.pop(0)
  12. for (x2,y2) in plist:
  13. if x2!=x1:
  14. break
  15. else:
  16. x3=x1+y2-y1
  17. if (x3,y2) in plist and (x3,y1) in plist: count+=1
  18. print(count)
Success #stdin #stdout 0.04s 63352KB
stdin
10
0 1
0 2
0 5
3 0
3 2
3 5
4 1
4 5
5 0
5 2
stdout
3