luogu#P7800. [COCI 2015/2016 #6] PAROVI
[COCI 2015/2016 #6] PAROVI
Problem Description
and are playing a game. First, chooses several pairs of coprime numbers from (he must choose at least one pair, and the two numbers in each pair must be different). For example, when , can choose some pairs from .
Then it is 's turn. He needs to find an such that for every pair , one of the following two conditions holds:
-
, .
-
, .
For example, if chooses , then can be .
If cannot find a value of that satisfies the condition, then wins. Now compute the total number of different choices for which wins, and output it modulo .
Input Format
The first line contains an integer .
Output Format
Output one integer: the number of different choices for which wins, modulo .
2
1
3
5
4
21
Hint
Sample 1 Explanation
has only one choice: .
Sample 2 Explanation
One possible choice for is .
Constraints
For of the testdata, .
Source
Translated from COCI 2015-2016 CONTEST #6 T4 PAROVI.
This problem uses the original COCI scoring, with full score .
Translated by ChatGPT 5