TopCoder

FHVirus
想像不出自己 AC 的題目是實作不出來的!

User's AC Ratio

87.1% (27/31)

Submission's AC Ratio

53.0% (44/83)

Tags

Description

在數學的自然數裡

「!」是指連續數列裡,連續數相乘
例:5!=5*4*3*2*1

「!!」是指連續數列裡,先隔一數後再相乘
例:5!!=5*3*1

「?!」是指人類大驚的表情
例:『什麼?!你是蘿莉控?!』

為了更了解!!!!!的奧義,你決定來分解一下n!
(輸入輸出格式請參考範例輸入輸出)

PS:這樣說來接下來是不是就會有「!!!」、「!!!!」、......?!?!...真妙!

Input Format

第1行包含一個正整數n,代表共有幾組測試資料(n<=10000)
第2行到第n+1行,每行各有一個數字k(0<=k<=10000)

Output Format

請將k!因數分解(格式請參考範例輸入輸出)

Sample Input 1

5
1
2
3
4
5

Sample Output 1

(1)
(2)
(2)*(3)
(2^3)*(3)
(2^3)*(3)*(5)

Hints

※2008/07/12:輸出說明修正by Tmt,感謝magrady。

Problem Source

原TIOJ1350 / 快樂暑假營第一次練習比賽。Problem Setter:hallogameboy

Subtasks

No. Testdata Range Score
1 0 100

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 262144 1