Programming contests

DEIK Regionális Programozó Csapatverseny, egyetemi/főiskolai kategória, 2012. november 25.

November 25, 2012 11:30 AM – November 25, 2012 4:30 PM

Is This Integration?

In the image below, you can see a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexes A, B, C, D as centers and a as the radius. The arc that is drawn taking A as center starts at neighboring vertex B and ends at neighboring vertex D. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You will have to determine the total area of these different shaped regions.

Input Specification

The input contains a floating-point number a (0 ≤ a ≤ 10000) in each line, which indicates the length of one side of the square. The input is terminated by end of file.

Output Specification

For each line of input, output in a single line the total area of the three types of region (filled with different patterns in the image above). These three numbers will, of course, be floating point numbers with three digits after the decimal point. The first number will denote the area of the striped region, the second number will denote the total area of the dotted regions, and the third number will denote the area of the rest of the regions.

Sample Input

  1. 0.1
  2. 0.2
  3. 0.3
download as text file

Output for Sample Input

  1. 0.003 0.005 0.002
  2. 0.013 0.020 0.007
  3. 0.028 0.046 0.016
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019