Advertisement
OIQ

kak

OIQ
Dec 15th, 2019
180
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. typedef long long ll;
  6.  
  7. int main() {
  8.  
  9.     ll n, m, t;
  10.  
  11.     cin >> n >> m >> t;
  12.  
  13.     if (n < m)
  14.         swap(n, m);
  15.  
  16.     ll r = n - m;
  17.  
  18.     ll h, w;
  19.  
  20.     if (m % 2 == 0)
  21.         h = 2;
  22.     else h = 1;
  23.  
  24.     w = h + r;
  25.  
  26.     while (n * m - w * h > t) {
  27.         w += 2;
  28.         h += 2;
  29.     }
  30.  
  31.     cout << (n - w) / 2;
  32.  
  33.     return 0;
  34. }
Advertisement
RAW Paste Data Copied
Advertisement