Practice on Toph

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

Jenia's Homework

By masrur · Limits 500ms, 512 MB

Jenia is a very talented girl. She got homework from school. She is such a nerd who cries if she can’t complete her homework every day. Yesterday her math teacher taught her about circles, semi-circles, square etc. gave her a geometric shape and asked her to find the area and perimeter of the shaded region given the area A of the Square where four quarter circles with the same radius are inside the square. She has been thinking and thinking for the whole evening and eventually slept with frustration. Can you help her to find the area and perimeter of the shaded region given the area of the square?


The first line of the input contains an integer T (1 ≤ T ≤ 103) The next T lines contain an integer A ( 0 < A < 108) denoting area of the square.


For each test case, output a line containing the area and the perimeter of the shaded region respectively. Errors of less than 10-6 will be ignored.


0.6438055098076551 5.4413980927026531



95% Solution Ratio

SoudipEarliest, 3M ago

abid_rexFastest, 0.0s

SMuniraLightest, 131 kB

RafeedShortest, 113B


Login to submit

Related Contests

16th December Programming Contest 2019 Ended at 2019-12-16 18:00:00 +0000 UTC