#include<iostream>
using namespace std;
long long a, b, k;
int main (){
    cin>>a>>b>>k;
    int kolkoputi = (b-a+1)/k;
    cout<<kolkoputi<<endl;
    if(k > b){
        cout<<(b-a+1)/2;
    }
    if((a%2 == 0 && k%2 == 0) || (a%2 == 1 && k%2 == 1)){
        cout<<1+(b-a)/2;
    }
    if((a%2==1 && k%2==0) || (a%2==0 && k%2==1)){
        cout<<kolkoputi-1+(b-a-(kolkoputi-1))/2;
    }


    return 0;
}
