#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 will become type , and vice versa.
After a long-time research, we find the rule of their evolution: suppose that there are exactly Nisepandas numbered from to , and after the year, the Nisepandas numbered () will get changed to another type.
Now, Nispandas are very Curious about the number of type and type nidepanda after years(count from ).
Inintially, all the Nisepandas are type in year.
As Nisepandas are all uneducated, they can only remember some number that very close to , that is to say for every , will be satisfied.
Input
The input consists of several test cases. There is a single number on the first line , the number of cases. Following lines contains two numbers and (), 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 and the number of type .
Samples
2
5 0
5 4
5 0
2 3
Resources
第五届ACM趣味程序设计竞赛第四场(正式赛)