There is a polyline going through points (0, 0) – (*x*, *x*) – (2*x*, 0) – (3*x*, *x*) – (4*x*, 0) – ... - (2*kx*, 0) – (2*kx* + *x*, *x*) – .... 

We know that the polyline passes through the point (*a*, *b*). Find minimum positive value *x* such that it is true or determine that there is no such *x*.
Only one line containing two positive integers *a* and *b* (1 ≤ *a*, *b* ≤ 10<sup class="upper-index">9</sup>).
#pragma comment(linker,"/STACK:100000000000,100000000000")

#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair
#define D double
#define pi pair<int,int>
#define si set <pi>
#define F first
#define S second
#define forn(i,n) for (int(i)=0;(i)<(n);i++)
#define forr(i,x,y) for (int(i)=(x);(i)<=(y);i++)
#define ford(i,x,y) for (int(i)=(x);(i)>=(y);i--)
#define rev reverse
#define in insert
#define er erase
#define all(n) (n).begin(),(n).end()
#define graf vector<vector<pi> >
#define graf1 vector<vector<ll> >
#define sqr(a) (a)*(a)
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define y1 asdadasdasd

const int INF=1e9;
const D cp=2*asin(1.0);
const D eps=1e-9;
const ll mod=1000000000;

using namespace std;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    ll a,b,c,cnt1=0,cnt2=0,s=0;
    cin>>a>>b>>c;
    cnt1+=(a/c)*(b/c);
    s=a*b-cnt1*c*c;
    cnt2=s/(c*c);
    if (cnt2*c*c<s) cnt2++;
    cout<<cnt1<<' '<<cnt2<<'\n';
    return 0;
}
