foldlでreverse maximum minimum