您的位置:首页 > 其它

水题 A Simple Task

2013-09-11 14:03 260 查看

A Simple Task

Time Limit : 2000/1000ms(Java/Other)   MemoryLimit : 65536/32768K (Java/Other)Total Submission(s) :18   AcceptedSubmission(s) : 11

Font: Times NewRoman | Verdana | Georgia

Font Size: ← →

Problem Description

Given a positive integer n and the odd integer o and thenonnegative integer p such that n = o2^p.ExampleFor n = 24, o = 3 and p = 3.TaskWrite a program which for each data set:reads a positive integer n,computes the odd integer o and the nonnegative integer p such thatn = o2^p,writes the result.

Input

The first line of the input contains exactly one positive integer dequal to the number of data sets, 1 <= d<= 10. The data sets follow.Each data set consists of exactly one line containing exactly oneinteger n, 1 <= n <=10^6.

Output

The output should consists of exactly d lines, one line for eachdata set.Line i, 1 <= i <= d, corresponds tothe i-th input and should contain two integers o and p separated bya single space such that n = o2^p.

Sample Input

24

Sample Output

3 3

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: