






from copy import deepcopy
class     a    :



      """simple docstring"""


      def __init__(      self					:			Any		,      __lowercase					:			Tuple = None		,      __lowercase					:			int = None					)							->      None:

        if arr is None and size is not None:
          __UpperCAmelCase							:	int           =  size
          __UpperCAmelCase							:	List[Any]           =  [0] * size
        elif arr is not None:
          self.init(A_					)
        else:
          raise ValueError("""Either arr or size must be specified"""					)
      def 	UpperCAmelCase      (      self					:			Any		,      __lowercase					:			str					)							->      None:
        __UpperCAmelCase							:	Optional[int]           =  len(A_					)
        __UpperCAmelCase							:	str           =  deepcopy(A_					)
        for i in range(1		,      self.size					):
          __UpperCAmelCase							:	List[Any]           =  self.next_(A_					)
          if j < self.size:
            self.tree[j] += self.tree[i]
      def 	UpperCAmelCase      (      self					:			Tuple					)							->      list[int]:
        __UpperCAmelCase							:	Optional[Any]           =  self.tree[:]
        for i in range(self.size - 1		,      0		,      -1					):
          __UpperCAmelCase							:	int           =  self.next_(A_					)
          if j < self.size:
            arr[j] -= arr[i]
        return arr
      @staticmethod
      def 	UpperCAmelCase      (      __lowercase					:			int					)							->      int:
        return index + (index & (-index))
      @staticmethod
      def 	UpperCAmelCase      (      __lowercase					:			List[str]					)							->      int:
        return index - (index & (-index))
      def 	UpperCAmelCase      (      self					:			List[Any]		,      __lowercase					:			Tuple		,      __lowercase					:			Union[str, Any]					)							->      None:
        if index == 0:
          self.tree[0] += value
          return
        while index < self.size:
          self.tree[index] += value
          __UpperCAmelCase							:	str           =  self.next_(A_					)
      def 	UpperCAmelCase      (      self					:			Any		,      __lowercase					:			List[Any]		,      __lowercase					:			Optional[int]					)							->      None:
        self.add(A_		,      value - self.get(A_					)					)
      def 	UpperCAmelCase      (      self					:			int		,      __lowercase					:			str					)							->      int:
        if right == 0:
          return 0
        __UpperCAmelCase							:	Dict           =  self.tree[0]
        right -= 1  # make right inclusive
        while right > 0:
          result += self.tree[right]
          __UpperCAmelCase							:	List[Any]           =  self.prev(A_					)
        return result
      def 	UpperCAmelCase      (      self					:			Any		,      __lowercase					:			int		,      __lowercase					:			Union[str, Any]					)							->      int:
        return self.prefix(A_					) - self.prefix(A_					)
      def 	UpperCAmelCase      (      self					:			Optional[Any]		,      __lowercase					:			List[str]					)							->      int:
        return self.query(A_		,      index + 1					)




      def 	UpperCAmelCase      (      self					:			List[str]		,      __lowercase					:			int					)							->      int:
        value -= self.tree[0]
        if value < 0:
          return -1

        __UpperCAmelCase							:	Tuple           =  1  # Largest power of 2 <= size
        while j * 2 < self.size:
          j *= 2

        __UpperCAmelCase							:	Dict           =  0

        while j > 0:
          if i + j < self.size and self.tree[i + j] <= value:
            value -= self.tree[i + j]
            i += j
          j //= 2
        return i


if __name__ == "__main__":
       import doctest

       doctest.testmod()




import requests


def       A       (					lowercase    ,       lowercase )   ->  None:
		'''simple docstring'''

		UpperCamelCase		=     {'Content-Type': 'application/json'}
		UpperCamelCase		=     requests.post(lowercase    ,       json={'text': message_body}    ,       headers=lowercase )
		if response.status_code != 200:
				UpperCamelCase		=     (
				    'Request to slack returned an error '
				    f'''{response.status_code}, the response is:\n{response.text}'''
				)
				raise ValueError(lowercase )


if __name__ == "__main__":
					# Set the slack url to the one provided by Slack when you create the webhook at
					# https://my.slack.com/services/new/incoming-webhook/
					send_slack_message("<YOUR MESSAGE BODY>", "<SLACK CHANNEL URL>")
