#Lutece0773. Nisepanda Dai Kazoku

Nisepanda Dai Kazoku

Migrated from Lutece 773 Nisepanda Dai Kazoku

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Long long ago, There are only two kind of Nisepanda. Every year, some of them will changed to another type, for example type AA will become type BB, and vice versa.

After a long-time research, we find the rule of their evolution: suppose that there are exactly NN Nisepandas numbered from 11 to NN, and after the kthk_{th} year, the Nisepandas numbered k,2×k,3×km×kk,2\times k,3\times k\cdots m\times k(m×knm\times k\leq n) will get changed to another type.

Now, Nispandas are very Curious about the number of type AA and type BB nidepanda after MM years(count from 11).

Inintially, all the Nisepandas are type AA in 1th1_{th} year.

As Nisepandas are all uneducated, they can only remember some number that very close to NN, that is to say for every MM, MN1000|M-N|\leq 1000 will be satisfied.

Input

The input consists of several test cases. There is a single number on the first line TT, the number of cases. Following TT lines contains two numbers nn and mm(0n1012,0m0\leq n\leq 10^{12}, 0\leq m), representing the number of the Nisepandas and the number of years passed.

Output

For each case, print two numbers in a single line, representing the number of type AA and the number of type BB.

Samples

2
5 0
5 4
5 0
2 3

Resources

第五届ACM趣味程序设计竞赛第四场(正式赛)