[Training] Anhui empty

Description

  You have a hollow \ (n-\) - dimensional hyperrectangle, the \ (I \) dimensional coordinates \ ([0, r_i] \ ) inside. Now you rectangular all true \ (\ sum \ limits_ {i = 1} ^ n x_i \ le S \) position completely filled with liquid, required volume of liquid to \ (998,244,353 \) modulo (if a fraction on inversion yuan).
  subtask3: for \ (1 \ le i \ le n \) have \ (r_i = S \)
  subtask4: \ (. 1 \ n-Le, r_i \ Le 500, \ Space S \ ^. 9 Le 10 \)

Solution

  Just get to play a special case subtask3 (without considering the coordinate range limit)
  two-dimensional case, the answer is the red zone area, apparently (\ frac {1} {2
  
} \) \   three-dimensional case, the answer is green and the lower right corner of the front lines three adjacent sides of the enclosed volume of space, based on elementary knowledge found \ (\ frac {1} { 6} \)(May be proved by calculus)
  
  It is possible to guess the answer is \ (\ S ^ {n-FRAC n-} {!} \) .
  For all that \ (r_i \ le S \) case, the answer will not be that \ (\ FRAC {\ prod_ {i = 1} ^ {} the n-r_i the n-!} \) ? Yes, indeed, may be proved by calculus ......

  Then consider the simple case.
  The problem with this as multiple restrictions, the general is not easy to directly solve, we try to find the number of cases the coordinates are not within range, and then subtracted from the total number of programs.
  For example, \ (n-= 2, \ Space R_1 = 1, \ Space R_2 =. 4, \ Space S = 2 \)
  We Imperial first \ (1 \) dimensional coordinate condition is not satisfied, i.e. \ (r_1 \ gt 1 \)

Guess you like

Origin www.cnblogs.com/scx2015noip-as-php/p/11619318.html