


'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__A		={
    'configuration_ctrl': ['CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'CTRLConfig'],
    'tokenization_ctrl': ['CTRLTokenizer'],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__A		=[
		    'CTRL_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'CTRLForSequenceClassification',
		    'CTRLLMHeadModel',
		    'CTRLModel',
		    'CTRLPreTrainedModel',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__A		=[
		    'TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFCTRLForSequenceClassification',
		    'TFCTRLLMHeadModel',
		    'TFCTRLModel',
		    'TFCTRLPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
		from .tokenization_ctrl import CTRLTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_ctrl import (
				    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
				    CTRLForSequenceClassification,
				    CTRLLMHeadModel,
				    CTRLModel,
				    CTRLPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_ctrl import (
				    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFCTRLForSequenceClassification,
				    TFCTRLLMHeadModel,
				    TFCTRLModel,
				    TFCTRLPreTrainedModel,
				)

else:
		import sys

		__A		=_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__   ):
			UpperCAmelCase__					:   List[str]       				=       len(UpperCamelCase__   )
			UpperCAmelCase__					:   List[Any]       				=       sum(UpperCamelCase__   )

			UpperCAmelCase__					:   List[str]       				=       [[False for x in range(s + 1   )] for y in range(n + 1   )]

			for i in range(1	, n + 1   ):
						UpperCAmelCase__					:   int       				=       True

			for i in range(1	, s + 1   ):
						UpperCAmelCase__					:   Dict       				=       False

			for i in range(1	, n + 1   ):
						for j in range(1	, s + 1   ):
									UpperCAmelCase__					:   int       				=       dp[i][j - 1]

									if arr[i - 1] <= j:
												UpperCAmelCase__					:   str       				=       dp[i][j] or dp[i - 1][j - arr[i - 1]]

			for j in range(int(s / 2   )	, -1	, -1   ):
						if dp[n][j] is True:
									UpperCAmelCase__					:   int       				=       s - 2 * j
									break

			return diff