시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 6 4 3 100.000%

문제

여왕께서 테라스 정원을 꾸미길 원하신다. 테라스 정원은 한 개의 중앙 돌과 그 돌을 동그랗게 둘러싼 동그란 돌들의 고리 여러 개로 이루어질 것이다. 중앙의 돌을 제외한 다른 돌들은 고리의 형태로 연속적으로 배열되며, 바로 안쪽의 고리(또는 중앙의 돌)와 바로 바깥쪽의 고리에(자기 자신이 가장 바깥쪽 고리가 아닐 경우) 접한 형태여야 한다. 또한, 각각의 고리를 이루는 돌들도 서로 접해야 하며, 각 고리를 이루는 돌의 개수는 동일해야 한다. 아래의 그림은 각각 1개의 고리와 3개의 돌, 5개의 고리와 11개의 돌로 꾸민 테라스의 예시이다.

여왕께서 아직 고리를 이룰 돌의 개수와 고리의 수를 정하지 않았기 때문에, 모든 고리의 수와 돌의 수에 대해 최소 어느 정도 크기의 테라스가 필요할지 계산해두려 한다. 테라스는 가장 바깥의 돌들을 둘러싸는 부분과 그 부분들을 직선으로 이어 만드는 형태이다.

중앙의 돌은 항상 반지름 1인 단위원이다.

입력

첫 줄에 테스트 케이스의 수 P가 주어진다. (1 ≤ P ≤ 1000)

각 테스트 케이스마다 테스트 케이스의 번호 T, 고리를 이루는 돌의 개수 N, 고리의 수 M이 주어진다. (3 ≤ N ≤ 20), (1 ≤ M ≤ 15)

출력

각 테스트 케이스마다 테스트 케이스의 번호와 마지막 고리를 이루는 돌의 반지름, 테라스의 둘레를 소수점 넷째 자리에서 반올림하여 셋째 자리까지 출력한다.

정답과의 오차가 0.005 이하일 경우 정답으로 처리된다.

예제 입력 1

3
1 3 1
2 7 3
3 11 5

예제 출력 1

1 6.464 79.400
2 3.834 77.760
3 2.916 82.481
W3sicHJvYmxlbV9pZCI6IjEwNDM5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjNWVjXHVjNjU1XHViMmQ4XHVjNzU4IFx1ZDE0Y1x1Yjc3Y1x1YzJhNCIsImRl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