#CCBCHBON0000016. Ước lớn nhất nhỏ hơn n (Largest Proper Divisor)
Ước lớn nhất nhỏ hơn n (Largest Proper Divisor)
Largest Proper Divisor
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given integer , print its largest positive divisor strictly less than . The divisor 1 is valid, including for a prime .
Input
One integer with .
Output
Print the largest positive divisor smaller than .
Subtasks
-
Subtask 1 (20%): .
-
Subtask 2 (30%): .
-
Subtask 3 (50%): .
Examples
Example 1
Input:
12
Output:
6
Explanation:
The largest positive divisor of 12 strictly below 12 is 6.
Example 2
Input:
13
Output:
1
Explanation:
The largest positive divisor of 13 strictly below 13 is 1.