Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Circle and Square

Limits: 500ms, 1.5 GB

Meena and Raju are learning about different shapes. Meena’s favourite shape is Circle while Raju likes Square. They start drawing their favourite shape wherever they can! But after a while they have started to feel bored. In the meantime Mithu came up with a idea of a interesting game!

The rules of the game are as follow:

  1. Meena has to draw a circle with radius R
  2. Raju has to draw the the inner square of Meena’s last drawn circle
  3. Meena has to draw the inner circle of Raju’s last drawn square
  4. continue from step 2

After playing the game for a few minutes they found out that the game will never end! But they wonder what will be the sum of the radius of the cirlces if they continue the game forever!

As Meena and Raju never get old, they are not so good in computation. But they know that you are participating the ‘Battle of Brains’ this year. So they’ve come to you. Can you help them?


On the first line there will be a single integer, T denoting the number of test cases (1 <= T <= 100). Then T lines will follow. Each of the line will contain a single integer R (1 <= R <= 10000).


For each of the test case print a single line containing a single number denoting the result with exacly 1 decimal place.



For floating point operation it is better to use double. And don’t forget the newline character.