

'''simple docstring'''
import flax.linen as nn
import jax
import jax.numpy as jnp







class 							A__   (	nn.Module  ):
  A__					=    42
  A__					=    jnp.floataa





  def 						A  (		self				:     Tuple			)     ->   List[Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =nn.Conv(
           self.out_channels							, kernel_size=(3, 3)							, strides=(1, 1)							, padding=((1, 1), (1, 1))							, dtype=self.dtype							, )





  def __call__(		self				:     Tuple							, _a				:     Any			)     ->   Any:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE   ,						_SCREAMING_SNAKE_CASE							   =hidden_states.shape
       _SCREAMING_SNAKE_CASE							   =jax.image.resize(
           _a							, shape=(batch, height * 2, width * 2, channels)							, method='nearest'							, )
       _SCREAMING_SNAKE_CASE							   =self.conv(_a			)
       return hidden_states







class 							A__   (	nn.Module  ):
  A__					=    42
  A__					=    jnp.floataa





  def 						A  (		self				:     Optional[int]			)     ->   Tuple:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =nn.Conv(
           self.out_channels							, kernel_size=(3, 3)							, strides=(2, 2)							, padding=((1, 1), (1, 1))							, dtype=self.dtype							, )





  def __call__(		self				:     List[str]							, _a				:     List[str]			)     ->   List[str]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =self.conv(_a			)
       return hidden_states







class 							A__   (	nn.Module  ):
  A__					=    42
  A__					=    None
  A__					=    0.0
  A__					=    None
  A__					=    jnp.floataa





  def 						A  (		self				:     Dict			)     ->   List[Any]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =self.in_channels if self.out_channels is None else self.out_channels

       _SCREAMING_SNAKE_CASE							   =nn.GroupNorm(num_groups=32							, epsilon=1e-5			)
       _SCREAMING_SNAKE_CASE							   =nn.Conv(
           _a							, kernel_size=(3, 3)							, strides=(1, 1)							, padding=((1, 1), (1, 1))							, dtype=self.dtype							, )

       _SCREAMING_SNAKE_CASE							   =nn.Dense(_a							, dtype=self.dtype			)

       _SCREAMING_SNAKE_CASE							   =nn.GroupNorm(num_groups=32							, epsilon=1e-5			)
       _SCREAMING_SNAKE_CASE							   =nn.Dropout(self.dropout_prob			)
       _SCREAMING_SNAKE_CASE							   =nn.Conv(
           _a							, kernel_size=(3, 3)							, strides=(1, 1)							, padding=((1, 1), (1, 1))							, dtype=self.dtype							, )

       _SCREAMING_SNAKE_CASE							   =self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

       _SCREAMING_SNAKE_CASE							   =None
       if use_nin_shortcut:
            _SCREAMING_SNAKE_CASE							   =nn.Conv(
                _a							, kernel_size=(1, 1)							, strides=(1, 1)							, padding='VALID'							, dtype=self.dtype							, )





  def __call__(		self				:     int							, _a				:     str							, _a				:     Any							, _a				:     List[str]=True			)     ->   Dict:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =hidden_states
       _SCREAMING_SNAKE_CASE							   =self.norma(_a			)
       _SCREAMING_SNAKE_CASE							   =nn.swish(_a			)
       _SCREAMING_SNAKE_CASE							   =self.conva(_a			)

       _SCREAMING_SNAKE_CASE							   =self.time_emb_proj(nn.swish(_a			)			)
       _SCREAMING_SNAKE_CASE							   =jnp.expand_dims(jnp.expand_dims(_a							, 1			)							, 1			)
       _SCREAMING_SNAKE_CASE							   =hidden_states + temb

       _SCREAMING_SNAKE_CASE							   =self.norma(_a			)
       _SCREAMING_SNAKE_CASE							   =nn.swish(_a			)
       _SCREAMING_SNAKE_CASE							   =self.dropout(_a							, _a			)
       _SCREAMING_SNAKE_CASE							   =self.conva(_a			)

       if self.conv_shortcut is not None:
            _SCREAMING_SNAKE_CASE							   =self.conv_shortcut(_a			)

       return hidden_states + residual



'''simple docstring'''
from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt


def 	_lowerCAmelCase (						_UpperCamelCase						:					int    )				->      bool:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =int(number**0.5    )
     return number == sq * sq


def 	_lowerCAmelCase (						_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int							,			_UpperCamelCase						:					int    )				->      tuple[int, int]:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
     _SCREAMING_SNAKE_CASE							   =x_den * y_den * z_den
     _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
     top //= hcf
     bottom //= hcf
     return top, bottom


def 	_lowerCAmelCase (						_UpperCamelCase						:					int = 35    )				->      int:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =set()
     _SCREAMING_SNAKE_CASE							   =42
     _SCREAMING_SNAKE_CASE							   =Fraction(0    )
     _SCREAMING_SNAKE_CASE							   =42

     for x_num in range(1							,			order + 1    ):
          for x_den in range(x_num + 1							,			order + 1    ):
               for y_num in range(1							,			order + 1    ):
                    for y_den in range(y_num + 1							,			order + 1    ):
                         # n=1
                         _SCREAMING_SNAKE_CASE							   =x_num * y_den + x_den * y_num
                         _SCREAMING_SNAKE_CASE							   =x_den * y_den
                         _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _SCREAMING_SNAKE_CASE							   =add_three(
                                  _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                              unique_s.add(_UpperCamelCase    )

                         # n=2
                         _SCREAMING_SNAKE_CASE							   =(
                             x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
                         )
                         _SCREAMING_SNAKE_CASE							   =x_den * x_den * y_den * y_den
                         if is_sq(_UpperCamelCase    ) and is_sq(_UpperCamelCase    ):
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _SCREAMING_SNAKE_CASE							   =add_three(
                                       _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                                   unique_s.add(_UpperCamelCase    )

                    # n=-1
                         _SCREAMING_SNAKE_CASE							   =x_num * y_num
                         _SCREAMING_SNAKE_CASE							   =x_den * y_num + x_num * y_den
                         _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                         z_num //= hcf
                         z_den //= hcf
                         if 0 < z_num < z_den <= order:
                              _SCREAMING_SNAKE_CASE							   =add_three(
                                  _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                              unique_s.add(_UpperCamelCase    )

                         # n=2
                         _SCREAMING_SNAKE_CASE							   =x_num * x_num * y_num * y_num
                         _SCREAMING_SNAKE_CASE							   =(
                             x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                         )
                         if is_sq(_UpperCamelCase    ) and is_sq(_UpperCamelCase    ):
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =int(sqrt(_UpperCamelCase    )    )
                              _SCREAMING_SNAKE_CASE							   =gcd(_UpperCamelCase							,			_UpperCamelCase    )
                              z_num //= hcf
                              z_den //= hcf
                              if 0 < z_num < z_den <= order:
                                   _SCREAMING_SNAKE_CASE							   =add_three(
                                       _UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase							,			_UpperCamelCase    )
                                   unique_s.add(_UpperCamelCase    )

     for num, den in unique_s:
          total += Fraction(_UpperCamelCase							,			_UpperCamelCase    )

     return total.denominator + total.numerator


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