
"""simple docstring"""



UpperCAmelCase__        =					{}
def    _UpperCAmelCase (					__lowerCamelCase  :			List[Any]					,   __lowerCamelCase  :			Optional[int]					,   __lowerCamelCase  :			Dict						)	->   str:


  if late == 3 or absent == 2:
    return 0

  # if we have no days left, and have not failed any other rules,
  # we have a prize string
  if days == 0:
    return 1

  # No easy solution, so now we need to do the recursive calculation

  # First, check if the combination is already in the cache, and
  # if yes, return the stored value from there since we already
  # know the number of possible prize strings from this point on
  _snake_case   	=			(days, absent, late)
  if key in cache:
    return cache[key]

  # now we calculate the three possible ways that can unfold from
  # this point on, depending on our attendance today

  # 1) if we are late (but not absent), the "absent" counter stays as
  # it is, but the "late" counter increases by one
  _snake_case   	=			_calculate(days - 1					,   lowerCamelCase_					,   late + 1						)

  # 2) if we are absent, the "absent" counter increases by 1, and the
  # "late" counter resets to 0
  _snake_case   	=			_calculate(days - 1					,   absent + 1					,   0						)

  # 3) if we are on time, this resets the "late" counter and keeps the
  # absent counter
  _snake_case   	=			_calculate(days - 1					,   lowerCamelCase_					,   0						)

  _snake_case   	=			state_late + state_absent + state_ontime

  _snake_case   	=			prizestrings
  return prizestrings
def    _UpperCAmelCase (					__lowerCamelCase  :			Optional[int] = 30						)	->   Optional[int]:
  return _calculate(lowerCamelCase_					,   absent=0					,   late=0						)


if __name__ == "__main__":
 print(solution())





'''simple docstring'''

def        UpperCAmelCase_ (  lowerCamelCase_			):







 """simple docstring"""


 lowerCAmelCase__     :   str     		=	len(lowerCamelCase_			)
 lowerCAmelCase__     :   Optional[Any]     		=	len(matrix[0]			)
 lowerCAmelCase__     :   Any     		=	min(lowerCamelCase_      ,			lowerCamelCase_			)

 for row in range(lowerCamelCase_			):
  # Check if diagonal element is not zero
  if matrix[row][row] != 0:
   # Eliminate all the elements below the diagonal
   for col in range(row + 1      ,			lowerCamelCase_			):
    lowerCAmelCase__     :   Tuple     		=	matrix[col][row] / matrix[row][row]
    for i in range(lowerCamelCase_      ,			lowerCamelCase_			):
     matrix[col][i] -= multiplier * matrix[row][i]
  else:
   # Find a non-zero diagonal element to swap rows
   lowerCAmelCase__     :   Dict     		=	True
   for i in range(row + 1      ,			lowerCamelCase_			):
    if matrix[i][row] != 0:
     lowerCAmelCase__		,     lowerCAmelCase__     :   Optional[Any]     		=	matrix[i], matrix[row]
     lowerCAmelCase__     :   Optional[Any]     		=	False
     break
   if reduce:
    rank -= 1
    for i in range(lowerCamelCase_			):
     lowerCAmelCase__     :   Union[str, Any]     		=	matrix[i][rank]

            # Reduce the row pointer by one to stay on the same row
   row -= 1

 return rank


if __name__ == "__main__":
     import doctest

     doctest.testmod()





