#include <bits/stdc++.h>
using namespace std;

using ll = long long;
constexpr int INF = (1<<30) - 1;
constexpr ll LLINF = (1ll<<60);

int main() {
        int C, N, M; cin >> C >> N >> M;

        ll dp[10005];
        fill_n(dp, 10005, -LLINF);
        dp[0] = 0;

        for (int i = 0; i < N; i++) {
                ll S, P; cin >> S >> P;
                for (int j = C; j >= 0; j--) {
                        if (j + S <= C) dp[j+S] = max(dp[j+S], dp[j] + P);
                }
        }
        for (int i = 1; i <= C; i++) {
                dp[i] = max(dp[i], dp[i-1]);
        }       

        for (ll k = 1; k <= M; k++) {
                cout << dp[C/k]*k << '\n';
        }       
        return (0);
}

