시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 1606 1261 1181 79.851%

문제

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

입력

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