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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll dp[10005], prevmax[10005];

int main() {
	cin.sync_with_stdio(false); cin.tie(0);
	cin.exceptions(cin.failbit);

	int c, n, m; cin >> c >> n >> m;

	rep(i, 1, 10005) dp[i] = -1;
	
	rep(i, 0, n) {
		int s, p; cin >> s >> p;
		for (int j = c - s; j >= 0; j--) if (dp[j] != -1) {
			dp[j + s] = max(dp[j + s], dp[j] + p);
		}
	}

	//rep(i, 0, c + 1) if (dp[i] != -1) printf("%d: %lld\n", i, dp[i]);
	rep(i, 1, c + 1) prevmax[i] = max(prevmax[i - 1], dp[i]);

	for (ll i = 1; i <= m; i++) {
		cout << i * prevmax[c / i] << '\n';
	}
}

