PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000080. Thử thách BCNN lớn nhất của ba số (LCM Challenge)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Thử thách BCNN lớn nhất của ba số (LCM Challenge)
LCM Challenge
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given a positive integer , choose exactly three positive integers (not necessarily distinct), each at most . Find the maximum possible value of over all choices. Print only that maximum value.
Input
One integer .
Output
Print one integer, the maximum possible LCM.
Subtasks
-
Subtask 1 (20 points): .
-
Subtask 2 (30 points): .
-
Subtask 3 (50 points): .
Examples
Input
9
Output
504
Explanation
Choose . They are pairwise coprime, so their LCM is . No triple of positive integers at most yields a larger LCM.