#P7488. 「Stoi2031」黑色毛衣
「Stoi2031」黑色毛衣
Description
This reminds Ran (然) of the time spent with Yu (雨). Since Yu is a girl who loves to play, they have many toys. Among them there is a kind of toy that looks like a white dragonfly, and it is now kept by Ran, with a total of of them. The wing lengths of the white dragonflies are respectively, and each pair of wings can be opened to any angle in . Ran thinks that choosing of these white dragonflies and opening their wings so that the distance between the tips of the two wings is an integer, and all these distances are pairwise distinct, is like weaving a memory. He considers two memories the same if and only if the white dragonflies can be reordered in some way and matched one-to-one such that the corresponding dragonflies have the same wing length and the same distance between wing tips. He wants you to tell him how many different memories can be woven. You only need to output .
Input Format
One line with three positive integers .
Output Format
One line with one integer, representing the answer.
32 2 47
36
233 223 1926817
620162
3 1 7
2
Hint
Brief statement of the problem
Count the number of different groups consisting of isosceles triangles, where the equal side length satisfies , the base length satisfies , and both are integers; all side lengths are pairwise distinct, and all base lengths are also pairwise distinct. Two groups are the same if and only if the triangles can be reordered in some way and matched one-to-one so that the corresponding triangles are congruent.
Sample explanation
Due to space limits, only Sample is explained.
One can weave , , , , , , , , , for a total of kinds of memories, and after taking modulo the result is .
This problem uses bundled tests. The score and constraints of each subtask are as follows.
| Subtask No. | Special Constraints | Score | |
|---|---|---|---|
| None | |||
| is prime |
For all testdata, , and is not guaranteed to be prime.
Translated by ChatGPT 5
京公网安备 11011102002149号