Namuk runs an egg shop and collects eggs from his chicken coop every day. One day he walked in and found that some of the chickens had lost a leg. He wanted to know how many chickens had lost a leg, but there were far too many to count one by one, so he counted every leg in the coop instead.
An intact chicken has two legs, and a chicken that lost a leg has one. Given the total number of legs and the number of chickens, solve Namuk's problem for him.
The first line contains the number of test cases T (T≤25).
Each of the next T lines contains the total number of chicken legs N (1≤N≤300) and the number of chickens M (M≤N≤2M), separated by a space.
For each test case, print the number of chickens that lost a leg and the number of intact chickens on one line, separated by a space.