/*  -*- coding: utf-8 -*-
 *
 * 2906.cc: Santa's Gift
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 10000;
const int MAX_M = 10000;
const int MAX_C = 10000;

/* typedef */

typedef long long ll;

/* global variables */

int ss[MAX_N], ps[MAX_N];
int dp[MAX_C + 1];

/* subroutines */

inline void setmax(int &a, int b) { if (a < b) a = b; }

/* main */

int main() {
  int c, n, m;
  scanf("%d%d%d", &c, &n, &m);

  for (int i = 0; i < n; i++) scanf("%d%d", ss + i, ps + i);

  memset(dp, -1, sizeof(dp));
  dp[0] = 0;

  for (int i = 0; i < n; i++)
    for (int j = c - ss[i]; j >= 0; j--)
      if (dp[j] >= 0)
	setmax(dp[j + ss[i]], dp[j] + ps[i]);
  for (int j = 0; j < c; j++) setmax(dp[j + 1], dp[j]);

  for (int k = 1; k <= m; k++) printf("%lld\n", (ll)dp[c / k] * k);
  return 0;
}

