• + 0 comments

    There's a mistake in multiple places in problem description (n should be the number of non-zero stones, but it's the number of all stones). Python3

        n -= 1
        solutions = set(a*i + b*(n-i) for i in range(n+1))
        return sorted(solutions)