#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, z;
  cin >> x >> y >> z;
  long long ans1 = x / z + y / z, ans2 = 0;
  x %= z;
  y %= z;
  if (x + y >= z) {
    ans1++;
    ans2 = min(z - x, z - y);
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
