Logo
(追記) (追記ここまで)

18575번 - Go West 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 512 MB58181365.000%

문제

Recently, the government of Byteland has signed an act called Go West. According to this act, every single Bytelandian can get a plot of land in the Far West free of charge!

The procedure of granting a plot is as follows. You are given a stick K millimeters long and a rope L millimeters long. The stick is inflexible, and the rope can be bent in any way. Next, you put the stick and the rope on the ground and measure the area S of the region that is surrounded by the stick and the rope. And then the government allocates a plot with an area of S square millimeters for you.

Formally, you have a segment with length K and a connected curve with length L. Place the segment and the curve on a plane. They split the plane into regions. Pick any finite region and calculate its area S. The curve may have any feasible shape, while the segment must remain intact. The figures can be rotated on the plane if necessary. You cannot change the length of the figures and cannot cut them into several pieces.

Naturally, you want the area of your Far Western plot to be as large as possible. Given K and L, find the maximum area S you can obtain.

입력

The first line contains a single integer T (1 ≤ T ≤ 105), the number of test cases.

Then T test cases follow, one test case per line, each containing two integers Ki and Li (1 ≤ Ki ≤ 105, 1 ≤ Li ≤ 105) separated by a single space: the lengths of the stick and the rope, respectively.

출력

In the i-th line, print a single real number Si: the answer for the i-th test case. Your answer will be considered correct if its absolute or relative error does not exceed 10−9.

제한

예제 입력 1

3
14 15
92 65
358 979

예제 출력 1

35.809862195676
672.429634563258
132235.233920283205

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 6: Belarusian SU Contest G번

Contest > Open Cup > 2018/2019 Season > Stage 12: Grand Prix of Belarus G번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /