Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):x=int(x);print(sum(1 for a,b in combinations_with_replacement(p[:x],2)if a+b==x))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(1 for c in p[1:x]if 2+c==x))
 elif x-4:print(sum(1 for a,b in combinations_with_replacement(p[1:x],2)if a+b==x))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(1 for c in p[1:x]if 2+c==x))
 elif x-4:print(sum(1 for a in p[1:x]for b in p[1:x]if a+b==x))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Runtime Error):
import bisect
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 y=bisect.bisect(p,x//2)
 if x%2:print(sum(1 for c in p[1:y]if 2+c==x))
 elif x-4:print(sum(1 for c in p[1:y]if a[x-c]))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Runtime Error):
import bisect
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 y=bisect.bisect(p,x//2)
 if x%2:print(sum(1 for c in p[1:x]if 2+c==x))
 elif x-4:print(sum(1 for c in p[1:y]if a[x-c]))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(49994);a=list(n)
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(1 for c in p[2:x]if 2+c==x))
 elif x-4:print(sum(1 for a,b in combinations_with_replacement(p[1:x],2)if a+b==x))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Runtime Error):
import bisect
from itertools import *
n=range(49994);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(2+c==x for c in p[:bisect.bisect(p,x)]))
 elif x-4:print(sum(1 for c in p[:bisect.bisect(p,x//2)]if a[x-c]))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Runtime Error):
import bisect
from itertools import *
n=range(49994);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(2+c==x for c in p[:bisect.bisect(p,x)-1]))
 elif x-4:print(sum(1 for c in p[:bisect.bisect(p,x//2)]if a[x-c]))
 else:print(1)


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
for x in iter(input,'0'):x=int(x);y=x//2+1;print(sum(a[x-d]>0 for d in compress(n[:y],a[:y])))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
for x in iter(input,'0'):x=int(x);y=x//2+1;print(sum(a[x-d]>0 for d in compress(n[:y],a[:y])))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
for x in iter(input,'0'):x=int(x);y=x//2+1;print(sum(a[x-d]>0 for d in a[:y]))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
for x in map(int,sys.stdin):
 if x:y=x//2+1;print(sum(1 for d in compress(n[:y],a[:y])if a[x-d]))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))

Buggy python submission (verdict: Runtime Error):
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len(1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]))


Fixed submission:
import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))