博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
acdream.LCM Challenge(数学推导)
阅读量:5213 次
发布时间:2019-06-14

本文共 830 字,大约阅读时间需要 2 分钟。

 LCM Challenge
Time Limit:1000MS     Memory Limit:64000KB     64bit IO Format:%lld & %llu
   

Description

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 thann. Can you help me to find the maximum possible least common multiple of these three integers?

Input

The first line contains an integer n (1 ≤ n ≤ 10^6) — the n mentioned in the statement.

Output

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

Sample Input

9

Sample Output

504
奇数时直接取前3,偶数时讨论前4(总共才三种)即可。

转载于:https://www.cnblogs.com/get-an-AC-everyday/p/4431903.html

你可能感兴趣的文章
滚动条
查看>>
程序员的自我修养九Windows下的动态链接
查看>>
BZOJ 4052: [Cerc2013]Magical GCD
查看>>
Codeforces Round #361 (Div. 2)
查看>>
oauth2学习
查看>>
Python time & datetime & string 相互转换
查看>>
细说WebSocket - Node篇
查看>>
1014 装箱问题——http://codevs.cn/problem/1014/
查看>>
poj 3177 边双联通 **
查看>>
java.lang.UnsupportedOperationException
查看>>
Linux operating system (Ubuntu) 学习-1
查看>>
Python字典实现分析
查看>>
jenkins+testNG
查看>>
Java自定义范型的应用技巧
查看>>
[洛谷1485] 火枪打怪
查看>>
白话经典算法系列之六 快速排序 快速搞定
查看>>
错了:用流量能够放肆,有wifi则要节制
查看>>
https://zhidao.baidu.com/question/362784520674844572.html
查看>>
【MFC 学习笔记】CFile读写文件
查看>>
PAT B1018.锤子剪刀布(20)
查看>>