#include <bits/stdc++.h>
using namespace std;
long long int m, n, num;
int main() {
  while (cin >> m >> n >> num) {
    cout << (m + n) / num << " ";
    long long int num1 = m % num, num2 = n % num;
    if (num1 + num2 >= num)
      cout << min(num - num1, num - num2) << endl;
    else
      cout << 0 << endl;
  }
  return 0;
}
