PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000043. Giá trị UCLN tối đa (Maximum GCD)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Giá trị UCLN tối đa (Maximum GCD)
Maximum GCD
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Choose distinct integers with . Determine the maximum possible ; do not output a pair.
Input
One line contains .
Output
Print the maximum GCD.
Subtasks
- Subtask 1 (20 points):
- Subtask 2 (30 points):
- Subtask 3 (50 points):
Examples
Input
5
Output
2
Explanation
Choosing and gives GCD ; no pair with GCD at least fits within through .