daily pastebin goal
21%
SHARE
TWEET

Untitled

a guest Jul 19th, 2014 266 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<stdio.h>
  3. #define ll long long
  4. using namespace std;
  5. ll n, m, k;
  6. ll get(ll a)
  7. {
  8.         return (n / (a + 1)) * (m / (k - a + 1));
  9. }
  10. int main()
  11. {
  12.         cin >> n >> m >> k;
  13.         if(n + m - 2 < k)
  14.                 cout << -1;
  15.         ll l, r;
  16.         l = max(0ll, k + 1 - m), r = min(k, n - 1);
  17.         cout << max(get(l), get(r)) << endl;
  18.         return 0;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top