Ten pin bowling is a popular game played around the world. Ten pins are arranged in an equilateral triangle. The pins are numbered to help with visualization and scoring. The head pin (the pin at the bottom of the triangle) is pin 1. As you move up the triangle, the subsequent pins are numbered from left to right (from the bowler's perspective), with the leftmost pin of each row being 1 more than the rightmost pin of the previous row. This gives the following arrangement for all 10 pins:
7 8 9 10
4 5 6
2 3
1
We're designing a bowling video game and we need to know the positions of the pins in screen coordinates - that is if the screen is laid out on a Cartesian plane we need to know the
- The
value of any pin is always greater than or equal to the value of a pin with a lower numbering; - The
value of any pin is always greater than or equal to the value of a pin to the left of it; - If you draw a straight line through any 2 pins (like the examples on the diagram below) all pins on that line are distributed evenly along its length
The input will contain
**Pin position is represented to a precision of
Here are some examples:
1.2345 -1
-1.25 2
3.01989 -2
Note that the sample input below only contains
Sample Input
0 0 0 0 1 0 5
-1.66667 -1 2.88675 -1
5 -1 8.66025 -1
1 1 1 1 8.66 0 5
1 1 1.49999 1
1.14433 1 1.24999 1
-1 1 1 1 8.66 0 5
-1 1 1 1
-1 1 1.49999 1
0 0 1.72222 1 1 2 5
-1.66667 1 4.60897 1
-5 1 1.03825 2
6 -1 6 -1 6 -2 5
5.7 -1 6.51962 -1
6.1 -1 6.17321 -1
Sample Output
2 10
5 3
1 5
2 7
7 3
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments
Could anyone please explain why there are six inputs on the first line instead of four? Or, am I not understanding this correctly?
X and Y are each represented by two numbers each.
As an example, to specify 10.2, this would be specified as
.
1.02 2
asEdit: See Ahmed's comment.
Write the 420 « Special Day » Contest!
:)
jumps off cliff
Write the 420 « Special Day » Contest!
when your comments are actually useful!