14725 - Factor   

Description

給定一個正整數 n,請找出所有能整除 n 的正整數,但不包含 1 與 n 本身。

將這些因數由小到大排序後輸出,每個數字之間以逗號, 分隔。

若沒有符合條件的因數,請輸出:

This number has no factors other than 1 and itself.

 

Input

輸入一行,包含一個正整數 n:

n

 

Note:

1. 1 ≤ n ≤ 100,000

 

Output

若有其他因數:

x1, x2, x3, ..., xn

 

若無其他因數:

This number has no factors other than 1 and itself.

 

Note:

1. 使用 for 迴圈從 1 到 n,並用:if (n % i == 0)判斷是否為因數。

2. 最後一個數字後不可有多餘空格,但要有換行符號 \n

3.最大測資為 1,000,000 時,最多也只會輸出約 100 個因數,不會造成效能問題。

 

Sample Input  Download

Sample Output  Download

Tags




Discuss