fork download
  1. import sys
  2. x=[]
  3. o=[]
  4. t=1
  5. b=","
  6. k=map
  7. def m(c):
  8. m=(o,x)[t];c=k(int,c.split(b))
  9. if c in o+x:
  10. print b;sys.exit()
  11. m+=c;r=0
  12. for p in m:r=w(p,m)
  13. return r
  14. def w(p,m):
  15. r=0
  16. for q in m:
  17. d=max(k(lambda x,y:abs(x-y),p,q))
  18. if d==u and e(pqm):r=1
  19. return r
  20. def e(p,q,m):
  21. v=k(lambda p,q:(p-q)/u,q,p);l=p;
  22. for i in range(1,n):
  23. y=k(lambda j,h:j+h,l,v)
  24. if y not in m:
  25. return 0
  26. l=y
  27. return l==q
  28. q=raw_input
  29. d=q()
  30. v=q()
  31. z=d.split(b)
  32. (n,d)=k(int,z)
  33. a=v.split(";")
  34. u=n-1
  35. for c in a:
  36. r=m(c)
  37. if r:print t
  38. t^=t
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty