KIDZEE1J - Divisors

no tags 

Print all the divisors of a given number.

একটি সংখ্যার সমস্ত গুণনীয়ক (উৎপাদক) বের করতে হবে।

Input

First line of input contains the number of test case T (T ≤ 10). Then each of the next T lines contains a single integer N, (1 ≤ N ≤ 100000).

ইনপুট ফাইলের প্রথম লাইনে থাকবে টেস্ট কেসের সংখ্যা T (T≤10). এরপরের পরবর্তী T সংখ্যক লাইনের প্রতিটিতে একটি করে পূর্ণ সংখ্যা N থাকবে, (1 ≤ N ≤ 100000).

Output

For each case print one line of output containing the case number first, then, all the divisors of N in increasing order. Each divisor must be printed exactly once. The divisors must be separated by single space character and there must not be any trailing spaces.

প্রতিটি কেসের জন্য একটি করে লাইন প্রিন্ট করতে হবে, শুরুতে কেইস নম্বর দিতে হবে। এরপর N এর সকল গুণনীয়ক ছোট থেকে বড় হিসেবে দেখাতে হবে এবং প্রতিটি গুণনীয়ক শুধুমাত্র একবার দেখাতে হবে। গুণনীয়ক গুলোকে শুধুমাত্র একটি স্পেস দিয়ে আলাদা করতে হবে এবং লাইনের শেষে কোনো অতিরিক্ত স্পেস থাকবে না।

Example

Input:
3
6
15
23

Output:
Case 1: 1 2 3 6
Case 2: 1 3 5 15
Case 3: 1 23

hide comments
vanvinhbk94: 2017-02-21 06:04:27

AC in one go

Bijoy Rahman Arif: 2014-11-17 04:26:04

I thought it is very complicated run time problem, alas I forgot it is tutorial.

Last edit: 2014-11-17 04:56:20

Added by:Shafaet
Date:2013-01-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem - Used for Junior Training