import random
random.seed (10111)
test = 15
def out(f,a,b,k):
  f.write("%d %d\n" % (len(a),k))
  for i in range(len(a)):
    if a[i] < 0: a[i] = 0
    if a[i] > 10: a[i] = 10
    f.write("%.5f %d\n" % (a[i],b[i]))
def gauss_a(sigma):
  a = []
  b = []
  for j in range(1,101):
    for i in range(100):
      delta = 1.0 - random.gauss(1.0,sigma)
      if delta > 1e-10: x = 1.0 + delta
      else:
        if delta < -1e-10: x = 1.0 / (1.0 - delta)
        else: x = 0.0;
      a.append(x)
      b.append(j)
  return a,b
##### small test which kill sorting by (a / b) ######
f = open ('%02d' % test, 'w')
test += 1
a = []
b = []
a.append(4.50517);
b.append(1);
a.append(8.76114);
b.append(2);
out(f,a,b,10000)
f.close()
################# all a = 0 #########################
f = open ('%02d' % test, 'w')
test += 1
a = []
b = []
for i in range(1,100):
  a.append(0);
  b.append(i);
out(f,a,b,10000)
f.close()

f = open ('%02d' % test, 'w')
test += 1
a = []
b = []
N = 1000
for i in range(1,N):
  x = i * 2.0 / N
  for j in range(1,101,10):
    a.append(x);
    b.append(j)
out(f,a,b,1)
f.close()

f = open ('%02d' % test, 'w')
test += 1
a,b = gauss_a(1.0)
out(f,a,b,1)
f.close()

f = open ('%02d' % test, 'w')
test += 1
a,b = gauss_a(2.0)
out(f,a,b,1)
f.close()

f = open ('%02d' % test, 'w')
test += 1
a,b = gauss_a(4.0)
out(f,a,b,1)
f.close()
