C. This is to give a rectangle and then cut it in the rectangle to ask the maximum area of the last smallest block (N/(x + 1 )) * (M/(Y + 1) x Y is the number of cross-cutting vertical knives. You can calculate the extreme value by solving the binary function, we need to remove this method from the green name when we need to complete the game.
# Include <iostream> # include <cstdio> # include <string. h> using namespace STD ;__ int64 n, m, K ;__ int64 maxv (_ int64 A, _ int64 B) {return A> B? A: B ;:__ int64 MINV (_ int64 A ,__ int64 B) {return A> B? B: A;} int main () {While (scanf ("% i64d % i64d % i64d", & N, & M, & K) = 3) {_ int64 L = maxv (0, K-m + 1); _ int64 r = MINV (K, n-1); If (k = 0) {printf ("% i64d \ n", N * m); continue;} If (k> N + m-2) {printf ("-1 \ n"); continue ;} _ int64 A = (N/(L + 1) * (M/(k-l + 1 )); _ int64 B = (N/(R + 1) * (M/(k-R + 1); a = maxv (A, B ); printf ("% i64d \ n", a);} return 0;} copy the codeView code
Codeforces round #257 (Div. 2)