Advertisement
cmiN

E

Sep 3rd, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5.  
  6. int crawl(int n, int m)
  7. {
  8.     int rows = n / 3;
  9.     if (n % 3) ++rows;
  10.     return (n - rows) * m;
  11. }
  12.  
  13.  
  14. int main()
  15. {
  16.     int n, m;
  17.     cin >> n >> m;
  18.     cout << max(crawl(n, m), crawl(m, n));
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement