> ... and let me reveal the secret: > http://spoj.sphere.pl/problems /SUPPER/ your question is different than the question on this website. also, what do you consider to be the correct output for this permutation? (according to your original question) [4, 5, 1, 2, 3, 6, 7, 8] Manuel