AC代码:
#include <stdio.h>
#define ll long long
ll max(ll a,ll b){return a>b?a:b;}
int main(){
ll n,m,k,ans,an;
scanf("%lld%lld%lld",&n,&m,&k);
if(k>n+m-2)
printf("-1\n");
else{
if(n>k+1)
ans=n/(k+1)*m;
else
ans=m/(k-n+2);
if(m>k+1)
an=m/(k+1)*n;
else
an=n/(k-m+2);
printf("%lld\n",max(ans,an));
}
return 0;
}