#Lutece1391. LRZ and Ellipses
LRZ and Ellipses
Migrated from Lutece 1391 LRZ and Ellipses
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Recently, the beauty of the mathematics fetched LRZ completely. Today, LRZ construct an ellipse with function . Now she find that she can rotate this ellipse by ()degrees counterclockwise around the original point to get a new ellipse .
You can understand this action as the following picture:
LRZ define as the length of the segment of and as the length of the segment of
is the point of the intersection of and in the first quadrant.
is the point of the intersection of and in the second quadrant.
For an integer , if LRZ can find an angle , so that and are also integers, she will call the triple a lucky triple.
Now LRZ is wondering, how many distinct lucky triples are there for from 1 to (inclusive).
For some stupid reasons we can regard triple and triple as the same triple.
Input
An integer
Output
You should output the number of lucky triples.
Samples
1000
7
Resources
IEEEXTREME Programming Competition