





"""simple docstring"""


import itertools





def SCREAMING_SNAKE_CASE_   (       snake_case   :					Optional[int] = 1_000_000		)->		int:
       _lowerCamelCase    	=					[1]

       for i in itertools.count(len(UpperCamelCase_		)		):
              _lowerCamelCase    	=					0
              for j in itertools.count(1		):
                     _lowerCamelCase    	=					-1 if j % 2 == 0 else +1
                     _lowerCamelCase    	=					(j * j * 3 - j) // 2
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number
                     index += j
                     if index > i:
                            break
                     item += partitions[i - index] * sign
                     item %= number

              if item == 0:
                     return i
              partitions.append(UpperCamelCase_		)

       return 0


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      print(f'{solution() = }')













def        lowerCAmelCase_       (							UpperCamelCase_    ,						UpperCamelCase_     )   ->						list:
       UpperCamelCase_      				=     sorted(UpperCamelCase_    ,						key=lambda UpperCamelCase_     : value[2]    ,						reverse=UpperCamelCase_     )

       # Create a list of size equal to the maximum deadline
       # and initialize it with -1
       UpperCamelCase_      				=     max(UpperCamelCase_    ,						key=lambda UpperCamelCase_     : value[1]     )[1]
       UpperCamelCase_      				=     [-1] * max_deadline

       # Finding the maximum profit and the count of jobs
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     0
       for job in jobs:
              # Find a free time slot for this job
              # (Note that we start from the last possible slot)
              for i in range(job[1] - 1    ,						-1    ,						-1     ):
                     if time_slots[i] == -1:
                            UpperCamelCase_      				=     job[0]
                            count += 1
                            max_profit += job[2]
                            break
       return [count, max_profit]


if __name__ == "__main__":
     import doctest

     doctest.testmod()

