P26666 [AtCoder] IOI Wafers
普及+
题目描述

Problem Description

You were playing by stacking large rectangular wafers on your desk in a spiral manner, layer by layer.

The first wafer can be placed arbitrarily, and each subsequent wafer is rotated so that one of its diagonals coincides with the highest wafer's diagonal and placed on top of it.

For example, in the following diagram, the first layer has a white wafer, and the second layer has a blue wafer.

You noticed that when placing a wafer, it might completely overlap with any of the already placed wafers. This is not aesthetically pleasing, so you decided to find out the maximum number of layers you can stack without any wafer overlapping when viewed from above.

Additionally, since you only have a protractor, you do not know the size of the wafers; instead, you are given the angle formed between the diagonal and the side of the wafer.

Input Format

None

Output Format

Output the number of wafers that can be stacked. Ensure a newline at the end of the output.

If it is possible to stack wafers indefinitely, return -1.

Sample Input and Output

Sample Input #1

30

Sample Output #1

3

Sample Input #2

18

Sample Output #2

5

Sample Input #3

45

Sample Output #3

1

Notes/Hints

Scoring

This problem is worth 100 points, with no partial points.

Sample Explanation 1

The fourth wafer cannot be placed as it would completely overlap with the first wafer.

Sample Explanation 3

Pay attention to the case where the wafer is a square.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
30
样例输出
3