시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 256 MB 1061 928 867 89.381%

문제

수학자가 구를 깎아서 볼록다면체를 만들었다. 이 수학자는 임의의 볼록다면체에 대해 (꼭짓점의 수) - (모서리의 수) + (면의 수) = 2가 성립한다는 것을 알고 있다. 그래서 구를 깎는 게 취미인 이 사람은 꼭짓점, 모서리와 면의 수를 기록할 때 꼭짓점과 모서리의 수만 세고 면의 수는 세지 않는다.

입력

첫 번째 줄에 1 이상 100 이하의 자연수 T가 주어진다.

다음 T개의 줄에 4 이상 100 이하의 자연수 V와 E가 공백을 사이에 두고 주어진다. V와 E는 각각 꼭짓점의 개수와 모서리의 개수이다.

출력

각 V와 E에 대해 볼록다면체의 면의 수를 한 줄에 하나씩 출력한다.

예제 입력 1

2
8 12
4 6

예제 출력 1

6
4
W3sicHJvYmxlbV9pZCI6IjEwNTY5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHViMmU0XHViYTc0XHVjY2I0IiwiZGVzY3JpcHRpb24iOiI8cCBzdHlsZT1cInRleHQtYWxpZ246Y2VudGVyXCI+PGltZyBhbHQ9XCJcIiBzcmM9XCJodHRwczpcL1wvd3d3LmFjbWljcGMubmV0XC91cGxvYWRcL2ltYWdlczJcL3BvbHkucG5nXCIgXC8+PFwvcD5cclxuXHJcbjxwPlx1YzIxOFx1ZDU1OVx1Yzc5MFx1YWMwMCBcdWFkNmNcdWI5N2MgXHVhZTRlXHVjNTQ0XHVjMTFjIFx1YmNmY1x1Yjg1ZFx1YjJlNFx1YmE3NFx1Y2NiNFx1Yjk3YyBcdWI5Y2NcdWI0ZTRcdWM1YzhcdWIyZTQuIFx1Yzc3NCBcdWMyMThcdWQ1NTlcdWM3OTBcdWIyOTQgXHVjNzg0XHVjNzU4XHVjNzU4IFx1YmNmY1x1Yjg1ZFx1YjJlNFx1YmE3NFx1Y2NiNFx1YzVkMCBcdWIzMDBcdWQ1NzQgKFx1YWYyZFx1YzlkM1x1YzgxM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