mirea-projects/First term/Algorithms/2-2/2.py
2024-09-24 02:22:33 +03:00

21 lines
354 B
Python
Executable File

def main() -> int:
a = int(input())
if a < 10:
return a
numbers = []
for divider in range(9, 1, -1):
while a % divider == 0:
a //= divider
numbers.append(divider)
if a >= 10:
return 0
return int("".join(map(str, sorted(numbers))))
if __name__ == "__main__":
print(main())