시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 1005 794 739 80.152%

문제

계란집을 운영하는 남욱이는 매일 닭장에서 달걀을 수거해간다. 어느날 닭장에 들어가보니 일부 닭의 다리가 하나씩 사라졌다. 남욱이는 얼마나 많은 닭들이 한 다리를 잃었는지 알고싶었지만 닭이 너무 많아 셀 수 없었고, 대신 모든 닭의 다리수를 셌다. 고민하는 남욱이를 위해 모든 닭의 다리수의 합과 닭의 수를 가지고 이것을 해결해주자.

입력

첫째 줄에 총 테스트 케이스의 수 T (T ≤ 25)가, 둘째 줄 부터 T + 1째줄까지 매줄 마다 모든 닭의 다리수의 합 N (1 ≤ N ≤ 300)과 닭의 수 M (M ≤ N ≤ 2M)이 공백을 간격으로 입력된다.

출력

테스트 케이스마다 한줄에 다리가 잘린 닭의 수 U와 멀쩡한 닭의 수 T를 공백을 간격으로 출력한다.

예제 입력 1

2
5 3
7 5

예제 출력 1

1 2
3 2
W3sicHJvYmxlbV9pZCI6IjExMDA2IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHViMGE4XHVjNmIxXHVjNzc0XHVjNzU4IFx1YjJlZFx1YzdhNSIsImRlc2NyaXB0aW9uIjoiPHA+XHVhY2M0XHViNzgwXHVjOWQxXHVjNzQ0IFx1YzZiNFx1YzYwMVx1ZDU1OFx1YjI5NCBcdWIwYThcdWM2YjFcdWM3NzRcdWIyOTQgXHViOWU0XHVjNzdjJm5ic3A7XHViMmVkXHVjN2E1XHVjNWQwXHVjMTFjIFx1YjJlY1x1YWM0MFx1Yzc0NCBcdWMyMThcdWFjNzBcdWQ1NzRcdWFjMDRcdWIyZTQuIFx1YzViNFx1YjI5MFx1YjBhMCBcdWIyZWRcdWM3YTVcdWM1ZDAgXHViNGU0XHVjNWI0XHVhYzAwXHViY2Y0XHViMmM4IFx1Yzc3Y1x1YmQ4MCBcdWIyZWRcdWM3NTggXHViMmU0XHViOWFjXHVhYzAwIFx1ZDU1OFx1YjA5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