closest integers with the same weight