PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000273. Phân tích một số thành thừa số nguyên tố (Factorize)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Phân tích một số thành thừa số nguyên tố (Factorize)

Factorize

Source: Library Checker

Version: Phuoc Hung OJ Extended

Problem Statement

Given a positive integer aa, factorize it into prime numbers. List each prime as many times as its multiplicity, in nondecreasing order. The integer 11 has no prime factors.

Input

One line contains the positive integer aa.

Output

Print exactly one line containing mm, the number of prime factors of aa counted with multiplicity, followed by the mm prime factors in nondecreasing order, separated by spaces. If a=1a=1, print only 0.

Subtasks

  • Subtask 1 (20 points): 1≤a≤1000001\le a\le 100000.
  • Subtask 2 (30 points): 1≤a≤10000000000001\le a\le 1000000000000.
  • Subtask 3 (50 points): 1≤a≤10000000000000000001\le a\le 1000000000000000000.

Examples

Example 1

Input

1

Output

0

Explanation

The input is a=1a=1. Since 11 has no prime factors, the number of prime factors counted with multiplicity is 00. The program prints 0.

Example 2

Input

60

Output

4 2 2 3 5

Explanation

Starting from 6060, divide successively by prime factors: 60÷2=3060\div 2=30; 30÷2=1530\div 2=15; 15÷3=515\div 3=5; 5÷5=15\div 5=1. The factors in nondecreasing order are 2,2,3,52, 2, 3, 5; there are 44 factors counting repetitions. Thus print 4 2 2 3 5.

Example 3

Input

756

Output

6 2 2 3 3 3 7

Explanation

Starting from 756756, divide successively by prime factors: 756÷2=378756\div 2=378; 378÷2=189378\div 2=189; 189÷3=63189\div 3=63; 63÷3=2163\div 3=21; 21÷3=721\div 3=7; 7÷7=17\div 7=1. The factors in nondecreasing order are 2,2,3,3,3,72, 2, 3, 3, 3, 7; there are 66 factors counting repetitions. Thus print 6 2 2 3 3 3 7.