Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> python <sourcefile>
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
>>> n = int(input())
m = int(input())
k = int(input())

L = min(n, m)
R = max(n, m)
D = n + m - 1

count = [0] * k

for d in range(1, L + 1):
    color = (d - 1) % k
    count[color] += d

if R > L:
    num_diagonals = R - L
    for r in range(k):
        d0 = L + 1 + ((r - (L % k)) % k)
        if d0 > R:
            continue
        d_last = R - ((R - d0) % k)
        num = (d_last - d0) // k + 1
        count[r] += num * L

for d in range(R + 1, D + 1):
    length = L - (d - R)
    color = (d - 1) % k
    count[color] += length

for c in count:
    print(c)
    return 0;
}