




'''simple docstring'''






from __future__ import annotations






def 		UpperCamelCase__			(		__SCREAMING_SNAKE_CASE		)						->      list[int]:
      assert (
          isinstance(__SCREAMING_SNAKE_CASE							,			__SCREAMING_SNAKE_CASE		) and mask > 0
      ), f"mask needs to be positive integer, your input {mask}"
      snake_case__					:      Optional[int]  			=						[]
      snake_case__					:      Any  			=						mask

      while submask:
            all_submasks.append(__SCREAMING_SNAKE_CASE		)
            snake_case__					:      List[str]  			=						(submask - 1) & mask

      return all_submasks


if __name__ == "__main__":
      import doctest

      doctest.testmod()






'''simple docstring'''






def 		UpperCamelCase__			(		__SCREAMING_SNAKE_CASE = 1000		)						->      int:
      snake_case__					:      List[str]  			=						0
      snake_case__					:      int  			=						(n - 1) // 3
      total += ((terms) * (6 + (terms - 1) * 3)) // 2  # total of an A.P.
      snake_case__					:      Optional[Any]  			=						(n - 1) // 5
      total += ((terms) * (10 + (terms - 1) * 5)) // 2
      snake_case__					:      Tuple  			=						(n - 1) // 15
      total -= ((terms) * (30 + (terms - 1) * 15)) // 2
      return total


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