Namuk's Chicken Coop

No attempts yetTime limit2sMemory limit256 MB

Problem

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.

Input

The first line contains the number of test cases TT (T25T \le 25).

Each of the next TT lines contains the total number of chicken legs NN (1N3001 \le N \le 300) and the number of chickens MM (MN2MM \le N \le 2M), separated by a space.

Output

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.