replaced floor{K/p} by ceil{K/p} everywhere