





'''simple docstring'''

import json
import sys







def  a__    (    lowercase :					List[Any], lowercase :					Union[str, Any]				)		->		str:





     """simple docstring"""

     with open(lowercase, encoding='''utf-8'''				) as f:
          _UpperCamelCase       =	json.load(lowercase				)

     _UpperCamelCase       =	['''<details>''', '''<summary>Show updated benchmarks!</summary>''', ''' ''']

     for benchmark_name in sorted(lowercase				):
          _UpperCamelCase       =	results[benchmark_name]

          _UpperCamelCase       =	benchmark_name.split('''/'''				)[-1]
          output_md.append(F"""### Benchmark: {benchmark_file_name}"""				)

          _UpperCamelCase       =	'''| metric |'''
          _UpperCamelCase       =	'''|--------|'''
          _UpperCamelCase       =	'''| new / old (diff) |'''
          for metric_name in sorted(lowercase				):
               _UpperCamelCase       =	benchmark_res[metric_name]
               _UpperCamelCase       =	metric_vals['''new''']
               _UpperCamelCase       =	metric_vals.get('''old''', lowercase				)
               _UpperCamelCase       =	metric_vals.get('''diff''', lowercase				)

               _UpperCamelCase       =	F""" {new_val:f}""" if isinstance(lowercase, (int, float)				) else '''None'''

               if old_val is not None:
                    val_str += F""" / {old_val:f}""" if isinstance(lowercase, (int, float)				) else "None"
               if dif_val is not None:
                    val_str += F""" ({dif_val:f})""" if isinstance(lowercase, (int, float)				) else "None"

               title += " " + metric_name + " |"
               lines += "---|"
               value += val_str + " |"

          output_md += [title, lines, value, " "]

     output_md.append('''</details>'''				)

     with open(lowercase, '''w''', encoding='''utf-8'''				) as f:
          f.writelines('''\n'''.join(lowercase				)				)


if __name__ == "__main__":
   lowercase__						:      List[str]	=    sys.argv[1]
   lowercase__						:      List[Any]	=    sys.argv[2]

   format_json_to_md(input_json_file, output_md_file)










'''simple docstring'''

def  a__    (    lowercase :					int, lowercase :					int, lowercase :					list[list[int]]				)		->		int:





     """simple docstring"""

     def update_area_of_max_square(lowercase :					int, lowercase :					int				) -> int:
          # BASE CASE
          if row >= rows or col >= cols:
               return 0

          _UpperCamelCase       =	update_area_of_max_square(lowercase, col + 1				)
          _UpperCamelCase       =	update_area_of_max_square(row + 1, col + 1				)
          _UpperCamelCase       =	update_area_of_max_square(row + 1, lowercase				)

          if mat[row][col]:
               _UpperCamelCase       =	1 + min([right, diagonal, down]				)
               _UpperCamelCase       =	max(largest_square_area[0], lowercase				)
               return sub_problem_sol
          else:
               return 0

     _UpperCamelCase       =	[0]
     update_area_of_max_square(0, 0				)
     return largest_square_area[0]







def  a__    (    lowercase :					int, lowercase :					int, lowercase :					list[list[int]]				)		->		int:





     """simple docstring"""

     def update_area_of_max_square_using_dp_array(
         lowercase :					int, lowercase :					int, lowercase :					list[list[int]]				) -> int:
          if row >= rows or col >= cols:
               return 0
          if dp_array[row][col] != -1:
               return dp_array[row][col]

          _UpperCamelCase       =	update_area_of_max_square_using_dp_array(lowercase, col + 1, lowercase				)
          _UpperCamelCase       =	update_area_of_max_square_using_dp_array(row + 1, col + 1, lowercase				)
          _UpperCamelCase       =	update_area_of_max_square_using_dp_array(row + 1, lowercase, lowercase				)

          if mat[row][col]:
               _UpperCamelCase       =	1 + min([right, diagonal, down]				)
               _UpperCamelCase       =	max(largest_square_area[0], lowercase				)
               _UpperCamelCase       =	sub_problem_sol
               return sub_problem_sol
          else:
               return 0

     _UpperCamelCase       =	[0]
     _UpperCamelCase       =	[[-1] * cols for _ in range(lowercase				)]
     update_area_of_max_square_using_dp_array(0, 0, lowercase				)

     return largest_square_area[0]







def  a__    (    lowercase :					int, lowercase :					int, lowercase :					list[list[int]]				)		->		int:





     """simple docstring"""

     _UpperCamelCase       =	[[0] * (cols + 1) for _ in range(rows + 1				)]
     _UpperCamelCase       =	0
     for row in range(rows - 1, -1, -1				):
          for col in range(cols - 1, -1, -1				):
               _UpperCamelCase       =	dp_array[row][col + 1]
               _UpperCamelCase       =	dp_array[row + 1][col + 1]
               _UpperCamelCase       =	dp_array[row + 1][col]

               if mat[row][col] == 1:
                    _UpperCamelCase       =	1 + min(lowercase, lowercase, lowercase				)
                    _UpperCamelCase       =	max(dp_array[row][col], lowercase				)
               else:
                    _UpperCamelCase       =	0

     return largest_square_area







def  a__    (    lowercase :					int, lowercase :					int, lowercase :					list[list[int]]				)		->		int:





     """simple docstring"""

     _UpperCamelCase       =	[0] * (cols + 1)
     _UpperCamelCase       =	[0] * (cols + 1)
     _UpperCamelCase       =	0
     for row in range(rows - 1, -1, -1				):
          for col in range(cols - 1, -1, -1				):
               _UpperCamelCase       =	current_row[col + 1]
               _UpperCamelCase       =	next_row[col + 1]
               _UpperCamelCase       =	next_row[col]

               if mat[row][col] == 1:
                    _UpperCamelCase       =	1 + min(lowercase, lowercase, lowercase				)
                    _UpperCamelCase       =	max(current_row[col], lowercase				)
               else:
                    _UpperCamelCase       =	0
          _UpperCamelCase       =	current_row

     return largest_square_area


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(largest_square_area_in_matrix_bottom_up(2, 2, [[1, 1], [1, 1]]))



