시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 731 596 557 82.275%

문제

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

입력

첫째줄에 총 테스트 케이스의 수 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+XHVhY2M0XHViNzgwXHVjOWQxXHVjNzQ0IFx1YzZiNFx1YzYwMVx1ZDU1OFx1YjI5NCBcdWIwYThcdWM2YjFcdWM3NzRcdWIyOTQgXHViOWU0XHVjNzdjJm5ic3A7XHViMmVkXHVjN2E1XHVjNWQwXHVjMTFjIFx1YjJlY1x1YWM0MFx1Yzc0NCBcdWMyMThcdWFjNzBcdWQ1NzRcdWFjMDRcdWIyZTQuIFx1YzViNFx1YjI5MFx1YjBhMCBcdWIyZWRcdWM3YTVcdWM1ZDAgXHViNGU0XHVjNWI0XHVhYzAwXHViY2Y0XHViMmM4IFx1Yzc3Y1x1YmQ4MCBcdWIyZWRcdWM3NTggXHViMmU0XHViOWFjXHVhYzAwIFx1ZDU1OFx1YjA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