## Baltic OI '05 P6 - Polygon

View as PDF

Points: 20
Time limit: 2.0s
Memory limit: 512M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Write a program to find a convex polygon whose sides have the given lengths.

In this task, we consider a polygon to be convex if all its inner angles are strictly greater than 0 degrees and strictly less than 180 degrees.

#### Input Specification

The first line of the file contains an integer , the number of vertices of the polygon . Each of the following lines contains an integer , the length of one side of the polygon .

#### Output Specification

If the desired polygon can be constructed, the output should contain exactly lines. Each line should contain two real numbers and such that by connecting the points and for all and additionally the points and with line segments, we obtain a convex polygon. The lengths of the line segments must be equal to the numbers given in the input file, but not necessarily in the same order.

The vertices of the constructed polygon can be listed either clockwise or counterclockwise.

If the polygon cannot be constructed, print NO SOLUTION on the single line of the output file.

#### Sample Input

4
7
4
5
4

#### Sample Output

0.5 2.5
7.5 2.5
4.5 6.5
0.5 6.5