#icpc2015summerday4d. [icpc2015summer_day4_d]Identity Function
[icpc2015summer_day4_d]Identity Function
MathJax.Hub.Config({ tex2jax: { inlineMath: [[""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12px; line-height: 18px; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }
Problem Statement
You are given an integer , which is greater than .
Consider the following functions:
Note that we use to represent the integer modulo operation. For a non-negative integer and a positive integer , is the remainder of divided by .
Output the minimum positive integer such that for all positive integers less than . If no such exists, output .
Input
The input consists of a single line that contains an integer (), whose meaning is described in the problem statement.
Output
Output the minimum positive integer such that for all positive integers less than , or if no such exists.
Sample Input 1
3```
### Output for the Sample Input 1
```plain
1```
* * *
### Sample Input 2
```plain
4```
### Output for the Sample Input 2
```plain
-1```
* * *
### Sample Input 3
```plain
15```
### Output for the Sample Input 3
```plain
2```
* * *