#include <stdio.h>

int main(int argc, char* argv[])
{
  int array = 4;
  int grown = 4;

  for (int i = 2; i <= 64000; ++i) {
    // simple array
    if (i > array) array += 4;

    // fancy power-of-n
    if (i > grown)
      grown += (grown >= 16) ? grown / 3 : 4;

    // btree computation
    int data = (i / 8) + (i % 8 ? 1 : 0);

    int empty = i % 8 ? 8 - (i % 8) : 0;

    int index = 0;
    int nodes = data;
    while (nodes > 1) {
      empty += nodes % 8 ? 8 - (nodes % 8) : 0;
      nodes = (nodes / 8) + (nodes % 8 ? 1 : 0);
      index += nodes;
    }

    printf("%d %0.2lf %0.2lf %0.2lf\n", i,
	   (double(i) / double(array)),
	   (double(i) / double(grown)),
	   (double(i) / ((9.0 * double(index)) + double(data) + double(i + empty))));
  }
}

