mirea-projects/First term/Algorithms/2-2/2.py

21 lines
354 B
Python
Raw Permalink Normal View History

2024-09-23 23:22:33 +00:00
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())