A Definite Game

2018-12-17 11:41:52


题目链接:

https://codeforces.com/contest/1081/problem/A

原题:

Problem Statement

Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some small games.

He came up with the following game. The player has a positive integer n. Initially the value of n equals to v and the player is able to do the following operation as many times as the player want (possibly zero): choose a positive integer x that x<n and x is not a divisor of n, then subtract x from n. The goal of the player is to minimize the value of n in the end.

Soon, Chouti found the game trivial. Can you also beat the game?

Input

The input contains only one integer in the first line: v (1≤v≤109), the initial value of n.

Output

Output a single integer, the minimum value of n the player can get.

Examples

input

8

output

1

input

1

output

1

Note

In the first example, the player can choose x=3 in the first turn, then n becomes 5. He can then choose x=4 in the second turn to get n=1 as the result. There are other ways to get this minimum. However, for example, he cannot choose x=2 in the first turn because 2 is a divisor of 8.

In the second example, since n=1 initially, the player can do nothing.


题意:

一个数n,减去x,这个x要小于n且不能整除n,求能获得的最小的n-x

思路:

沙雕题,n=2的时候输出2,n为其他数的时候输出1,原因自己去证明。

AC代码:

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#include<algorithm>
#include<queue>
typedef long long ll;
#include<vector>
#define cin(n) scanf("%lld",&(n))
#define cout(n) printf("%lld",(n))
#define couc(c) printf("%c",(c))
#define coutn printf("\n")
#define cout_ printf(" ")
#define debug() printf("haha\n")
const int MAXN= 1e6 + 5 ;
ll t;
ll n,k;
ll a[1005];
ll ans;
char s[1005];
int main()
{
    cin(t);
    if(t==2)
        printf("2\n");
    else
    printf("1\n");
    return 0;
}