2062 - Pyramid's Maintenance

Created by Tomás Orlando Junco Vázquez
Added by ymondelo20 (2012-10-12)
Limits
Total Time: 3000 MS | Test Time: 2000 MS |Memory: 62 MB | Output: 64 MB | Size: 29 KB
Enabled languages
Available in

Description

Recently, the caribbean archeologist and world-famous Nilo Pyramo published one of his most correct theories after several fact-finding years on the egyptian pyramids: The big Pharaohs' tombs.

In particular, he always asked himself how those wonderful constructions, after 3000 years of bearing the intense heats of the desert, still stand on their feet, available for our generations' admiration. According to the great archeologist, at first these buildings received maintenance in a continuous way, applying all the exposed faces with some antirust chemicals that apparently the egyptian civilization discovered and was obtaining of nature. Curiously, the exact composition of these exclusive substances of this ancient civilization is still ignored.

The egyptian pyramids were, generally, regular pyramids, with square base and lateral faces that were perfect equilateral triangles. Their enormous dimensions impressed all. The most notable case is Cheops’s pyramid, whose construction took thirty years of tireless work. According to the investigator, this construction exposed a giant diamond in the top. For this reason, in addition to its enormous size and complexity of the structure, it became one of the indisputable wonders of the ancient world.

Nilo Pyramo has discovered and translated some papyruses where the process of application of the protective chemicals was described from the days of yore: "…The process begins in the dangerous task of placing a rope from the base of the pyramid to Ammon’s sacred diamond. This rope, which allows supporting utensils and facilitates the workers' climb and descent, is initially appointed in the base of the edge shared by the northern and eastern faces. After that, forming always an angle a with the base edge of the face where the worker entrusted with this task is, the rope is fixed carefully from the bottom of the pyramid, all the way to the top. The sketch begins on the northern face and is repeated in the western face maintaining the angle of inclination, next in the southern face, next on the eastern face, next again on the northern face and so on... always ascending. Thanks to our architects' precision with the layout of the angles, it is guaranteed that the rope, describing a giant-sized and perfect spiral in three dimensions, converges in the sacred diamond…"



As from the study of this text, one of the big questions is how much rope it was needed to surround with this spiral sketch the biggest pyramids, like Cheops’s. You will be given the dimensions of the base of the pyramid and the angle of inclination (relative to the edge base) of the rope. Would you calculate the length of the rope? If you can do it, possibly you are a descendant of some magnificent egyptian architect.
Recently, the caribbean archeologist and world-famous Nilo Pyramo published one of his most correct theories after several fact-finding years on the egyptian pyramids: The big Pharaohs' tombs.

In particular, he always asked himself how those wonderful constructions, after 3000 years of bearing the intense heats of the desert, still stand on their feet, available for our generations' admiration. According to the great archeologist, at first these buildings received maintenance in a continuous way, applying all the exposed faces with some antirust chemicals that apparently the egyptian civilization discovered and was obtaining of nature. Curiously, the exact composition of these exclusive substances of this ancient civilization is still ignored.

The egyptian pyramids were, generally, regular pyramids, with square base and lateral faces that were perfect equilateral triangles. Their enormous dimensions impressed all. The most notable case is Cheops’s pyramid, whose construction took thirty years of tireless work. According to the investigator, this construction exposed a giant diamond in the top. For this reason, in addition to its enormous size and complexity of the structure, it became one of the indisputable wonders of the ancient world.

Nilo Pyramo has discovered and translated some papyruses where the process of application of the protective chemicals was described from the days of yore: "…The process begins in the dangerous task of placing a rope from the base of the pyramid to Ammon’s sacred diamond. This rope, which allows supporting utensils and facilitates the workers' climb and descent, is initially appointed in the base of the edge shared by the northern and eastern faces. After that, forming always an angle a with the base edge of the face where the worker entrusted with this task is, the rope is fixed carefully from the bottom of the pyramid, all the way to the top. The sketch begins on the northern face and is repeated in the western face maintaining the angle of inclination, next in the southern face, next on the eastern face, next again on the northern face and so on... always ascending. Thanks to our architects' precision with the layout of the angles, it is guaranteed that the rope, describing a giant-sized and perfect spiral in three dimensions, converges in the sacred diamond…"



As from the study of this text, one of the big questions is how much rope it was needed to surround with this spiral sketch the biggest pyramids, like Cheops’s. You will be given the dimensions of the base of the pyramid and the angle of inclination (relative to the edge base) of the rope. Would you calculate the length of the rope? If you can do it, possibly you are a descendant of some magnificent egyptian architect.
Recently, the caribbean archeologist and world-famous Nilo Pyramo published one of his most correct theories after several fact-finding years on the egyptian pyramids: The big Pharaohs' tombs.

In particular, he always asked himself how those wonderful constructions, after 3000 years of bearing the intense heats of the desert, still stand on their feet, available for our generations' admiration. According to the great archeologist, at first these buildings received maintenance in a continuous way, applying all the exposed faces with some antirust chemicals that apparently the egyptian civilization discovered and was obtaining of nature. Curiously, the exact composition of these exclusive substances of this ancient civilization is still ignored.

The egyptian pyramids were, generally, regular pyramids, with square base and lateral faces that were perfect equilateral triangles. Their enormous dimensions impressed all. The most notable case is Cheops’s pyramid, whose construction took thirty years of tireless work. According to the investigator, this construction exposed a giant diamond in the top. For this reason, in addition to its enormous size and complexity of the structure, it became one of the indisputable wonders of the ancient world.

Nilo Pyramo has discovered and translated some papyruses where the process of application of the protective chemicals was described from the days of yore: "…The process begins in the dangerous task of placing a rope from the base of the pyramid to Ammon’s sacred diamond. This rope, which allows supporting utensils and facilitates the workers' climb and descent, is initially appointed in the base of the edge shared by the northern and eastern faces. After that, forming always an angle a with the base edge of the face where the worker entrusted with this task is, the rope is fixed carefully from the bottom of the pyramid, all the way to the top. The sketch begins on the northern face and is repeated in the western face maintaining the angle of inclination, next in the southern face, next on the eastern face, next again on the northern face and so on... always ascending. Thanks to our architects' precision with the layout of the angles, it is guaranteed that the rope, describing a giant-sized and perfect spiral in three dimensions, converges in the sacred diamond…"



As from the study of this text, one of the big questions is how much rope it was needed to surround with this spiral sketch the biggest pyramids, like Cheops’s. You will be given the dimensions of the base of the pyramid and the angle of inclination (relative to the edge base) of the rope. Would you calculate the length of the rope? If you can do it, possibly you are a descendant of some magnificent egyptian architect.

Input specification

First line in the input contains one integer T that represents the number of cases. T lines follows, each one containing two integers a and b, the input for each case. The value of a represents the angle in degrees formed between the cord and the horizontal (0 < a <= 15). The value of b denotes the dimension in meters of the pyramid’s base (1 <= b <= 300).
First line in the input contains one integer T that represents the number of cases. T lines follows, each one containing two integers a and b, the input for each case. The value of a represents the angle in degrees formed between the cord and the horizontal (0 < a <= 15). The value of b denotes the dimension in meters of the pyramid’s base (1 <= b <= 300).
First line in the input contains one integer T that represents the number of cases. T lines follows, each one containing two integers a and b, the input for each case. The value of a represents the angle in degrees formed between the cord and the horizontal (0 < a <= 15). The value of b denotes the dimension in meters of the pyramid’s base (1 <= b <= 300).

Output specification

For each case, output a new line containing the length of the used cord. Print the result with exactly four decimal digits.

For each case, output a new line containing the length of the used cord. Print the result with exactly four decimal digits.

First line in the input contains one integer T that represents the number of cases. T lines follows, each one containing two integers a and b, the input for each case. The value of a represents the angle in degrees formed between the cord and the horizontal (0 < a <= 15). The value of b denotes the dimension in meters of the pyramid’s base (1 <= b <= 300).

Sample input

2
15 200
10 246

Sample output

669.2130
1226.8614

Hint(s)

π = acos(-1) = 2×acos(0)

π = acos(-1) = 2×acos(0)

π = acos(-1) = 2×acos(0)