题库练习 LCM Challenge
← 上一题 下一题 →

A8696 | LCM Challenge

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Some days ago, I learned the concept of LCM (least common multiple). I've played with it for several times and I want to make a big number with it.

But I also don't want to use many numbers, so I'll choose three positive integers (they don't have to be distinct) which are not greater than $n$ . Can you help me to find the maximum possible least common multiple of these three integers?

输入格式

The first line contains an integer $n$ ( $1<=n<=10^{6}$ ) — the $n$ mentioned in the statement.

输出格式

Print a single integer — the maximum possible LCM of three not necessarily distinct positive integers that are not greater than $n$ .

输入输出样例

输入 #1
9
输出 #1
504
输入 #2
7
输出 #2
210
C++ 编辑器
输入
输出