version presque optimale, MAIS ATTENTION, max incorrect