#include <bits/stdc++.h>
using namespace std;
int main(){
  int C, N, M;
  cin >> C >> N >> M;
  vector<int> s(N), p(N);
  for (int i = 0; i < N; i++){
    cin >> s[i] >> p[i];
  }
  vector<int> dp(C + 1, 0);
  for (int i = 0; i < N; i++){
    for (int j = C; j >= s[i]; j--){
      dp[j] = max(dp[j], dp[j - s[i]] + p[i]);
    }
  }
  for (int i = 1; i <= M; i++){
    cout << dp[C / i] * i << endl;
  }
}
