开发者社区> 问答> 正文

A Simple Task

18666053854Given a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p.

Example

For n = 24, o = 3 and p = 3.

Task

Write a program which for each data set:

reads a positive integer n,

computes the odd integer o and the nonnegative integer p such that n = o2^p,

writes the result.

Input

The first line of the input contains exactly one positive integer d equal to the number of data sets, 1 <= d <= 10. The data sets follow.

Each data set consists of exactly one line containing exactly one integer n, 1 <= n <= 10^6.

Output

The output should consists of exactly d lines, one line for each data set.

Line i, 1 <= i <= d, corresponds to the i-th input and should contain two integers o and p separated by a single space such that n = o2^p.

Sample Input

1 24

Sample Output ———————————————— 版权声明:本文为CSDN博主「wynswd」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/wynswd/article/details/86669094

展开
收起
游客odnzwz7f4juco 2019-12-02 14:14:05 587 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Multi-Task Learning for E-comm 立即下载
Fighting Cybercrime: A Joint Task Force of Real-Time Data and Human Analytics 立即下载
Froma single droplet toafull b 立即下载