


'''simple docstring'''




from manim import *



class  lowerCAmelCase				(				a							):



	def 				lowercase     (					self    ):
		lowerCAmelCase					:    int      							= Rectangle(height=0.5 ,					width=0.5    )
		lowerCAmelCase					:    List[str]      							= Rectangle(height=0.4_6 ,					width=0.4_6    ).set_stroke(width=0    )

		lowerCAmelCase					:    Any      							= [mem.copy() for i in range(6    )]
		lowerCAmelCase					:    Union[str, Any]      							= [mem.copy() for i in range(6    )]
		lowerCAmelCase					:    str      							= VGroup(*snake_case__    ).arrange(snake_case__ ,					buff=0    )
		lowerCAmelCase					:    Any      							= VGroup(*snake_case__    ).arrange(snake_case__ ,					buff=0    )
		lowerCAmelCase					:    str      							= VGroup(snake_case__ ,					snake_case__    ).arrange(snake_case__ ,					buff=0    )
		lowerCAmelCase					:    Dict      							= Text('CPU' ,					font_size=24    )
		lowerCAmelCase					:    Union[str, Any]      							= Group(snake_case__ ,					snake_case__    ).arrange(snake_case__ ,					buff=0.5 ,					aligned_edge=snake_case__    )
		cpu.move_to([-2.5, -0.5, 0]    )
		self.add(snake_case__    )

		lowerCAmelCase					:    str      							= [mem.copy() for i in range(1    )]
		lowerCAmelCase					:    Any      							= VGroup(*snake_case__    ).arrange(snake_case__ ,					buff=0    )
		lowerCAmelCase					:    Optional[int]      							= Text('GPU' ,					font_size=24    )
		lowerCAmelCase					:    List[Any]      							= Group(snake_case__ ,					snake_case__    ).arrange(snake_case__ ,					buff=0.5 ,					aligned_edge=snake_case__    )
		gpu.align_to(snake_case__ ,					snake_case__    )
		gpu.set_x(gpu.get_x() - 1    )

		self.add(snake_case__    )

		lowerCAmelCase					:    Dict      							= [mem.copy() for i in range(6    )]
		lowerCAmelCase					:    Dict      							= VGroup(*snake_case__    ).arrange(snake_case__ ,					buff=0    )

		lowerCAmelCase					:    Tuple      							= Text('Model' ,					font_size=24    )
		lowerCAmelCase					:    Optional[Any]      							= Group(snake_case__ ,					snake_case__    ).arrange(snake_case__ ,					buff=0.5 ,					aligned_edge=snake_case__    )
		model.move_to([3, -1.0, 0]    )

		self.play(
		    Create(snake_case__ ,					run_time=1    ) ,					Create(snake_case__ ,					run_time=1    ) ,					Create(snake_case__ ,					run_time=1    ) ,					)

		lowerCAmelCase					:    Tuple      							= MarkupText(
		    f"First, an empty model skeleton is loaded\ninto <span fgcolor='{YELLOW}'>memory</span> without using much RAM." ,					font_size=24 ,					)

		lowerCAmelCase					:    List[Any]      							= Square(side_length=2.2    )
		key.move_to([-5, 2, 0]    )

		lowerCAmelCase					:    List[Any]      							= MarkupText(
		    f"<b>Key:</b>\n\n<span fgcolor='{YELLOW}'>●</span> Empty Model" ,					font_size=18 ,					)

		key_text.move_to([-5, 2.4, 0]    )

		step_a.move_to([2, 2, 0]    )
		self.play(Write(snake_case__ ,					run_time=2.5    ) ,					Write(snake_case__    ) ,					Write(snake_case__    )    )

		self.add(snake_case__    )

		lowerCAmelCase					:    List[str]      							= []
		lowerCAmelCase					:    Optional[Any]      							= []
		lowerCAmelCase					:    List[Any]      							= []
		for i, rect in enumerate(snake_case__    ):
			lowerCAmelCase					:    List[str]      							= Rectangle(height=0.4_6 ,					width=0.4_6    ).set_stroke(width=0.0    ).set_fill(snake_case__ ,					opacity=0.7    )
			cpu_target.move_to(snake_case__    )
			cpu_target.generate_target()
			lowerCAmelCase					:    str      							= 0.4_6 / 4
			lowerCAmelCase					:    Optional[Any]      							= 0.4_6 / 3

			if i == 0:
				cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT    ) ,					buff=0.0_2 ,					direction=snake_case__    )
				cpu_target.target.set_x(cpu_target.target.get_x() + 0.1    )
			elif i == 3:
				cpu_target.target.next_to(cpu_targs[0].target ,					direction=snake_case__ ,					buff=0.0    )
			else:
				cpu_target.target.next_to(cpu_targs[i - 1].target ,					direction=snake_case__ ,					buff=0.0    )
			cpu_targs.append(snake_case__    )

			first_animations.append(rect.animate(run_time=0.5    ).set_stroke(snake_case__    )    )
			second_animations.append(MoveToTarget(snake_case__ ,					run_time=1.5    )    )

		self.play(*snake_case__    )
		self.play(*snake_case__    )

		self.wait()



'''simple docstring'''




import math

def 			__UpperCamelCase    (    _A    :				int = 1_00				)    ->      int:




	"""simple docstring"""





	lowerCAmelCase					:    List[Any]      							= sum(i * i for i in range(1					,   n + 1				)				)
	lowerCAmelCase					:    Optional[Any]      							= int(math.pow(sum(range(1					,   n + 1				)				)					,   2				)				)
	return square_of_sum - sum_of_squares


if __name__ == "__main__":
				print(f"""{solution() = }""")
