#include using namespace std; using ll = long long; using vll = vector; using vvll = vector; #define all(A) A.begin(),A.end() #define rep(i, n) for (ll i = 0; i < (ll) (n); i++) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll N,M,K; cin>>N>>M>>K; ll P=M*(N-1); ll Q=N*(N-K-1); ll G=gcd(P,Q); cout<