Optimal Learning of Mallows Block Model