#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int sasha_chiz, masha_chiz, coconut_price, sasha_buy_co,
      masha_buy_co, sum_buy_co, given_chiz = 0;
  cin >> sasha_chiz >> masha_chiz >> coconut_price;
  sasha_buy_co = sasha_chiz / coconut_price;
  masha_buy_co = masha_chiz / coconut_price;
  if (sasha_chiz % coconut_price != 0 && masha_chiz % coconut_price != 0) {
    sasha_chiz = sasha_chiz % coconut_price;
    masha_chiz = masha_chiz % coconut_price;
    if (sasha_chiz + masha_chiz >= coconut_price) {
      if (sasha_chiz >= masha_chiz) {
        given_chiz = coconut_price - sasha_chiz;
        sasha_buy_co = sasha_buy_co + 1;
      } else {
        given_chiz = coconut_price - masha_chiz;
        masha_buy_co = masha_buy_co + 1;
      }
    }
  }
  sum_buy_co = sasha_buy_co + masha_buy_co;
  cout << sum_buy_co << " " << given_chiz;
  return 0;
}
