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