# [Python 2], <s>48</s> 43 bytes

Returns `0` on error.

<!-- language-all: lang-python -->

    lambda m,n:m/n and[m/n]*(n-m%n)+m%n*[m/n+1]

[Try it online!][TIO-j51bj013]

[Python 2]: https://docs.python.org/2/
[TIO-j51bj013]: https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFXJ88qVz9PITEvJRpIx2pp5OnmquZpagMJLZCItmHs/5KiSisuzvKMzJxUhZCi0lQgh7OgKDOvRCFNQyszr6C0RENTkyu1Ijm1oETB1d/NtagovwioqCCxuPi/mY4xlzkYGwGxIRBbcBkaGOhYAAA "Python 2 – Try It Online"


----------


### 41 bytes (with @xnor's trick)

Throws `ValueError` on error.

<!-- language-all: lang-python -->

    lambda m,n:[m/n or _]*(n-m%n)+m%n*[m/n+1]

[Try it online!][TIO-j51bkvri]

[Python 2]: https://docs.python.org/2/
[TIO-j51bkvri]: https://tio.run/##TYpPC4IwGIfP26fYJZx/IjUoETrasS7dSmLWRMG9jtdJ@enXsoIOzw9@D4@eTNNDauvdxXZCVXfBVAT5Wa2A9ciuZcBhqRbgh26Ctw6T0hqcckoeTdtJdsJRukM@jhCNLRhW86AFPRru@07K501qww5CyQKxx7/Qm4VHv0lx3P8KLYbBbqI13c6kjsSR0SSOo@wF "Python 2 – Try It Online"