#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, ans = 0, xmin;
  scanf("%lld%lld%lld", &a, &b, &c);
  ans += a / c + b / c;
  a %= c;
  b %= c;
  if (a + b >= c) {
    ans++;
    xmin = min(c - a, c - b);
  } else
    xmin = 0;
  printf("%lld %lld\n", ans, xmin);
  return 0;
}
