
"""simple docstring"""
import unittest

import numpy as np
import torch

from diffusers import VersatileDiffusionImageVariationPipeline
from diffusers.utils.testing_utils import load_image, require_torch_gpu, slow, torch_device


SCREAMING_SNAKE_CASE_					     =	False
class       lowerCAmelCase_		(				unittest.TestCase ):



							'''simple docstring'''





							pass
@slow
@require_torch_gpu
class       lowerCAmelCase_		(				unittest.TestCase ):



							'''simple docstring'''





							def    A__						( self				)       ->  Optional[int]:
													__lowerCAmelCase     =  VersatileDiffusionImageVariationPipeline.from_pretrained("""shi-labs/versatile-diffusion"""				)
													pipe.to(snake_case_				)
													pipe.set_progress_bar_config(disable=snake_case_				)

													__lowerCAmelCase     =  load_image(
													    """https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg"""				)
													__lowerCAmelCase     =  torch.manual_seed(0				)
													__lowerCAmelCase     =  pipe(
													    image=snake_case_    ,				generator=snake_case_    ,				guidance_scale=7.5    ,				num_inference_steps=50    ,				output_type="""numpy"""    ,				).images

													__lowerCAmelCase     =  image[0, 253:256, 253:256, -1]

													assert image.shape == (1, 512, 512, 3)
													__lowerCAmelCase     =  np.array([0.0_441, 0.0_469, 0.0_507, 0.0_575, 0.0_632, 0.0_650, 0.0_865, 0.0_909, 0.0_945]				)

													assert np.abs(image_slice.flatten() - expected_slice				).max() < 1e-2


"""simple docstring"""
import os

def  lowercase     ():
						with open(os.path.dirname(_lowerCAmelCase						) + """/grid.txt"""						) as f:
												__lowerCAmelCase     =  []  # noqa: E741
												for _ in range(20						):
																		l.append([int(_lowerCAmelCase						) for x in f.readline().split()]						)

												__lowerCAmelCase     =  0

												# right
												for i in range(20						):
																		for j in range(17						):
																								__lowerCAmelCase     =  l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # down
												for i in range(17						):
																		for j in range(20						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # diagonal 1
												for i in range(17						):
																		for j in range(17						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp

        # diagonal 2
												for i in range(17						):
																		for j in range(3 ,    20						):
																								__lowerCAmelCase     =  l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																								if temp > maximum:
																														__lowerCAmelCase     =  temp
												return maximum


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