codility-Frogjump, in C