And a D solution for the second contest, still for LDC2 compiler, translated from C++ code by "ilmale": http://dpaste.dzfl.pl/f029aa2c0a46 Timing comparisons are welcome. Bye, bearophile