




from PIL import Image



def 							_A       (						lowerCAmelCase_					: Image       ,    lowerCAmelCase_					: int      ):
     """simple docstring"""

     lowerCAmelCase__          =			(259 * (level + 255)) / (255 * (259 - level))

     def contrast(lowerCAmelCase_					: int      ) -> int:
          return int(128 + factor * (c - 128)      )

     return img.point(lowerCAmelCase_      )


if __name__ == "__main__":
     # Load image
     with Image.open('image_data/lena.jpg') as img:
          # Change contrast to 170
          UpperCamelCase								=					change_contrast(img, 170)
          cont_img.save('image_data/lena_high_contrast.png', format='png')






def 							_A       (						lowerCAmelCase_					: int = 1000      ):
     """simple docstring"""

     return sum(2 * a * ((a - 1) // 2) for a in range(3       ,    n + 1      )      )


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