Under construction

Still being built. Things may change

Circles Inside a Square

Time limit1sMemory limit1024 MB

Summary
Given the radius r of 8 equal circles, find the area of the smallest square that can hold them without overlap.
Level

Medium6 of 10

Topics
Geometry, Math
Solved
No attempts yet

Problem

You have 8 circles of equal size and you want to pack them inside a square. You want to minimize the size of the square. The following figure shows the minimum way of packing 8 circles inside a square:

Given the radius rr, find the area of the smallest square into which 8 circles of that radius can be packed.

Input

The first line contains a positive integer nn, the number of test cases. Each test case is a single line containing a positive real number rr, the radius. rr is between 0.001 and 1000, inclusive.

Output

For each test case, output the area of the smallest square that can hold 8 circles of radius rr. Print 5 digits after the decimal point. Your answer is correct if it is within ±0.00001\pm 0.00001 of the judge's answer.

Examples1

  1. Example 1

    Input
    2
    0.1
    0.2
    
    Expected output
    0.34383
    1.37532