luogu#P7800. [COCI 2015/2016 #6] PAROVI

[COCI 2015/2016 #6] PAROVI

Problem Description

Mirko\text{Mirko} and Slavko\text{Slavko} are playing a game. First, Mirko\text{Mirko} chooses several pairs of coprime numbers from 1N1 \dots N (he must choose at least one pair, and the two numbers in each pair must be different). For example, when N=5N = 5, Mirko\text{Mirko} can choose some pairs from {{1,2},{3,4},{2,5},{3,5},}\big\{\{1,2\},\{3,4\},\{2,5\},\{3,5\},\cdots\big\}.

Then it is Slavko\text{Slavko}'s turn. He needs to find an x[2,N]x \in \big[2, N\big] such that for every pair {a,b}\{a,b\}, one of the following two conditions holds:

  • aa, b<xb < x.

  • aa, bxb \ge x.

For example, if Mirko\text{Mirko} chooses {{1,2},{3,4}}\big\{\{1,2\},\{3,4\}\big\}, then xx can be 33.

If Slavko\text{Slavko} cannot find a value of xx that satisfies the condition, then Mirko\text{Mirko} wins. Now compute the total number of different choices for which Mirko\text{Mirko} wins, and output it modulo 10910^9.

Input Format

The first line contains an integer NN.

Output Format

Output one integer: the number of different choices for which Mirko\text{Mirko} wins, modulo 10910^9.

2
1
3
5
4
21

Hint

Sample 1 Explanation

Slavko\text{Slavko} has only one choice: {{1,2}}\big\{\{1,2\}\big\}.

Sample 2 Explanation

One possible choice for Slavko\text{Slavko} is {{1,2},{1,3}}\big\{\{1,2\},\{1,3\}\big\}.

Constraints

For 100%100\% of the testdata, 1N201 \le N \le 20.

Source

Translated from COCI 2015-2016 CONTEST #6 T4 PAROVI.

This problem uses the original COCI scoring, with full score 120120.

Translated by ChatGPT 5