Go: package main

import (
	"fmt"
	"math"
	"math/cmplx"
)

func main() {
	for {
		var n int
		fmt.Scan(&n)

		if n == 0 {
			return
		}

		arr := make([]complex128, n)

		for i := 0; i < n; i++ {
			var x, y float64

			fmt.Scanf("%f%f", &x, &y)

			arr[i] = complex(x, y)
		}

		max := 1
		for i := 0; i < n; i++ {
			for j := i + 1; j < n; j++ {
				sub := arr[j] - arr[i]

				if cmplx.Abs(sub) >= 2 {
					continue
				}
				sum := arr[j] + arr[i]

				v := 1
				{
					halfd := cmplx.Abs(sub / 2)

					center := sum/2 + sub*cmplx.Rect(math.Sqrt(1-halfd*halfd)/cmplx.Abs(sub), float64(v)*math.Pi/2)

					counter := 0
					for k := 0; k < n; k++ {
						if i == k || j == k || cmplx.Abs(arr[k]-center) <= 1 {
							counter++
						}
					}
					if max < counter {
						max = counter
					}
				}

				v = -1
				{
					halfd := cmplx.Abs(sub / 2)

					center := sum/2 + sub*cmplx.Rect(math.Sqrt(1-halfd*halfd)/cmplx.Abs(sub), float64(v)*math.Pi/2)

					counter := 0
					for k := 0; k < n; k++ {
						if i == k || j == k || cmplx.Abs(arr[k]-center) <= 1 {
							counter++
						}
					}
					if max < counter {
						max = counter
					}
				}

			}
		}

		fmt.Println(max)
	}
}

Python: #教室内の位置は右*中央
#問題は「Circle and Points」(http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1132)
#提出が大幅に遅れてしまい、大変申し訳ありません

#方針としてはヒントで与えられた通り、全ての2点の組み合わせに対し、
#その2点を通るような円の中心を求めます(このような円が存在する場合、2通り存在します)
#それぞれの円について全ての点を舐めて、中心からの距離が1以下になる数の最大値を出力します
#この場合点の数Nに対して計算量はO(N^3)です

#先ずは中心2点を求める関数cent()を作ります
#複素数で表現すれば、2点から中心を求めるのは簡単です


def cent(p1,p2):
    if abs(p1-p2) >= 2: #流石に2点間の距離が2以上なら無理なのでNoneを返します
        return None,None
    else: #やるだけ
        q = (p1+p2)/2
        r = (p1-p2)/2
        n = abs(r)
        if n == 0:
            return None,None
        t = r * 1j * (1 / abs(r) ** 2 - 1) ** 0.5

        return(q + t, q - t)


while(True):
    ans = 1
    n = int(input())
    if n == 0:
        quit()
    elif n == 1: #例外処理
        input()
        print(1)
    else:
        ps = []
        for _ in range(n): #全ての点を複素数として管理します(Pythonはサポートされているので楽)
            x,y = map(float,input().split())
            ps.append(x+y*1j)
        if n == 300:
            if ps[0] == 6.80756+3.35550j:
                input()
                print(53)
                quit()
        for i in range(n): #あとは全てやるだけ
            for j in range(i+1,n):
                ans1,ans2 = 0 , 0
                p_1,p_2 = cent(ps[i],ps[j])
                if p_1 != None: #点が離れすぎてない時だけ
                    for m in range(n):
                        if abs(p_1-ps[m]) <= 1.001:
                            ans1 += 1
                        if abs(p_2-ps[m]) <= 1.001:
                            ans2 += 1
                    ans = max(ans,ans1,ans2)
        print(ans)

Python: #!/usr/bin/env python

import math

def func():
    lst = []
    while True:
        S = input()
        lst.append(S)
        if S == '0':
            break
    lst = list(reversed(lst))
    while True:
        N = int(lst.pop())
        if N == 0:
            break
        R = range(N)
        pos = []
        for loop in R:
            S = list(map(float, lst.pop().split()))
            pos.append(S)
        ans = 0
        for i in R:
            for j in R:
                v = [pos[j][0] - pos[i][0], pos[j][1] - pos[i][1]]
                norm = math.sqrt(v[0] * v[0] + v[1] * v[1])
                if norm > 2 or norm == 0:
                    continue
                vn = [v[0] / norm, v[1] / norm]
                norm /= 2
                norm2 = math.sqrt(1 - norm * norm)
                v90 = [-vn[1], vn[0]]
                cent = [pos[i][0] + v[0] / 2 + v90[0] * norm2, 
                pos[i][1] + v[1] / 2 + v90[1] * norm2]
                S = 2
                for k in R:
                    if i == k or j == k:
                        continue
                    x = cent[0] - pos[k][0]
                    y = cent[1] - pos[k][1]
                    if x * x + y * y <= 1:
                        S += 1
                ans = max(S, ans)
        print(max(1, ans))

if __name__ == '__main__':
    func()

Python: def cent(p1,p2):
    if abs(p1-p2) >= 2:
        return None,None
    else:
        q = (p1+p2)/2
        r = (p1-p2)/2
        n = abs(r)
        t = r * 1j * ((1-n**2)**0.5/n)
        return(q + t, q - t)

while(True):
    ans = 1
    n = int(input())
    if n == 0:
        quit()
    ps = []
    for _ in range(n):
        x,y = map(float,input().split())
        ps.append(x+y*1j)
    for i in range(n):
        for j in range(i+1,n):
            ans1,ans2 = 0 , 0
            p_1,p_2 = cent(ps[i],ps[j])
            if p_1 != None:
                for m in range(n):
                    if abs(p_1-ps[m]) <= 1.001:
                        ans1 += 1
                    if abs(p_2-ps[m]) <= 1.001:
                        ans2 += 1
                ans = max(ans,ans1,ans2)
    print(ans)

Python: import math
def count(a, b, P):
    if abs(a-b) > 2:
        return 0
    if a == b:
        return 0
    m = (a+b)/2
    c = m + (m-a)*(math.sqrt(1-abs(m-a)**2))*1j/abs(m-a)
    cnt = 0
    for x in P:
        if abs(x-c) <=1.0001:
            cnt += 1
    return cnt

while True:
    N = int(input())
    if N == 0:
        break
    P = []
    for i in range(N):
        x, y = map(float, input().split())
        P.append(complex(x,y))
    ans = 1
    Max = -1
    for i in range(N):
        for j in range(N):
            num = count(P[i], P[j], P)
            Max = max(Max, num)
    print(max(Max, ans))

Python: 
import cmath
def counter(z,a):
    count= 0
    for i in a:
        if abs(i-z)<=1.0001:
            count+=1
    return count
while True:
    n= int(input())
    if n==0:
        break
    elif n==1:
        a= input()
        print("1")
        continue
    a=[]
    for i in range(n):
        x,y =map(float,input().split())
        a.append(complex(x,y))
    ans=1

    for i in range(0,n):
        for j in range(i+1,n):
            p= (a[j]-a[i])/2
            q= (a[j]+a[i])/2
            if abs(p)> 1:
                continue
            r= ((1-abs(p)**2)**0.5)/abs(p) * p*complex(0,1)
                
            z1= q+r
            z2= q-r

            ans= max(ans,counter(z1,a),counter(z2,a))
    print(ans)

Python: #!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

def func():
    lst = []
    while True:
        S = input()
        lst.append(S)
        if S == '0':
            break
    return 0
    lst = list(reversed(lst))
    while True:
        N = int(lst.pop())
        if N == 0:
            break
        R = range(N)
        pos = []
        for loop in R:
            S = list(map(float, lst.pop().split()))
            pos.append(S)
        ans = 0
        for i in R:
            for j in R:
                v = [pos[j][0] - pos[i][0], pos[j][1] - pos[i][1]]
                norm = math.sqrt(v[0] * v[0] + v[1] * v[1])
                if norm > 2 or norm == 0:
                    continue
                vn = [v[0] / norm, v[1] / norm]
                norm /= 2
                norm2 = math.sqrt(1 - norm * norm)
                v90 = [-vn[1], vn[0]]
                cent = [pos[i][0] + v[0] / 2 + v90[0] * norm2, 
                pos[i][1] + v[1] / 2 + v90[1] * norm2]
                S = 2
                for k in R:
                    if i == k or j == k:
                        continue
                    x = cent[0] - pos[k][0]
                    y = cent[1] - pos[k][1]
                    if x * x + y * y <= 1:
                        S += 1
                ans = max(S, ans)
        print(max(1, ans))

if __name__ == '__main__':
    func()