Type: Default 1000ms 256MiB

非因数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题面背景

因数_百度百科 (baidu.com)

题目描述

给你一个整数 nn, 你可以执行 00 次或多次以下操作:

选择一个比 nn 小的且不是 nn 的因数的 xx, 让 nn 变为 nxn-x

请给出最后 nn 的最小值.

输入格式

给你一个整数 nn

输出格式

输出一个整数表示最后 nn 的最小值

样例 #1

样例输入 #1

9

样例输出 #1

1

样例1解释

第一步可以选择 44, 让 94=59-4=5, nn 变成 55

第二步可以选择 22, 让 52=35-2=3, nn 变成 33

第三步可以选择 22, 让 32=13-2=1, nn 变成 11

之后无法再次减少 nn

提示

  • 1n10001≤n≤1000

信竞12月测试

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2023-12-28 15:30
End at
2023-12-28 18:30
Duration
3 hour(s)
Host
Partic.
2