• + 8 comments

    Python solution:

    print ' '.join(map(str,sorted({x*a+(n-1-x)*b for x in xrange(n)})))