Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- def main():
- if n == 1:
- print(1)
- return
- def f(x):
- global n
- k = 0
- while n % x == 0:
- k += 1
- n //= x
- return k
- s = ""
- cnt2, cnt3 = f(2), f(3)
- s += "8" * (cnt2 // 3)
- s += "9" * (cnt3 // 2)
- s += ["", "2", "4", "3", "6", "26"][cnt3 % 2 * 3 + cnt2 % 3]
- s += "5" * f(5)
- s += "7" * f(7)
- if n != 1:
- print("лимитированная партия")
- return
- print(''.join(sorted(s)))
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement