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(总共才三种)即可。

acdream.LCM Challenge(数学推导)的更多相关文章

  1. acdream LCM Challenge (最小公倍数)

    LCM Challenge Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others) Su ...

  2. 借One-Class-SVM回顾SMO在SVM中的数学推导--记录毕业论文5

    上篇记录了一些决策树算法,这篇是借OC-SVM填回SMO在SVM中的数学推导这个坑. 参考文献: http://research.microsoft.com/pubs/69644/tr-98-14.p ...

  3. [codeforces 235]A. LCM Challenge

    [codeforces 235]A. LCM Challenge 试题描述 Some days ago, I learned the concept of LCM (least common mult ...

  4. Codeforces Round #146 (Div. 1) A. LCM Challenge 水题

    A. LCM Challenge 题目连接: http://www.codeforces.com/contest/235/problem/A Description Some days ago, I ...

  5. 关于不同进制数之间转换的数学推导【Written By KillerLegend】

    关于不同进制数之间转换的数学推导 涉及范围:正整数范围内二进制(Binary),八进制(Octonary),十进制(Decimal),十六进制(hexadecimal)之间的转换 数的进制有多种,比如 ...

  6. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

  7. A - LCM Challenge

    A - LCM Challenge Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others ...

  8. 『sumdiv 数学推导 分治』

    sumdiv(POJ 1845) Description 给定两个自然数A和B,S为A^B的所有正整数约数和,编程输出S mod 9901的结果. Input Format 只有一行,两个用空格隔开的 ...

  9. LDA-线性判别分析(二)Two-classes 情形的数学推导

    本来是要调研 Latent Dirichlet Allocation 的那个 LDA 的, 没想到查到很多关于 Linear Discriminant Analysis 这个 LDA 的资料.初步看了 ...

随机推荐

  1. Android开发的那些坑和小技巧

    1.android:clipToPadding 意思是控件的绘制区域是否在padding里面.默认为true.如果你设置了此属性值为false,就能实现一个在布局上事半功陪的效果.先看一个效果图. 上 ...

  2. Ubuntu 上创建常用磁盘阵列

    RAID(Redundant Array of Independent Disk 独立冗余磁盘阵列)技术是加州大学伯克利分校1987年提出,最初是为了组合小的廉价磁盘来代替大的昂贵磁盘,同时希望磁盘失 ...

  3. Android Studio之gradle的配置与介绍

    1.gradle的简单介绍 Gradle是可以用于Android开发的新一代的Build System,也是Android Studio默认的build工具.其实Gradle脚本是基于一种JVM语言- ...

  4. java之Cookie详解

    Cookie是由服务器端生成,发送给User-Agent(一般是浏览器),浏览器会将Cookie的key/value保存到某个目录下的文本文件内,下次请求同一网站时就发送该Cookie给服务器(前提是 ...

  5. Java技术路线图

    在技术方面无论我们怎么学习,总感觉需要提升自已不知道自己处于什么水平了.但如果有清晰的指示图供参考还是非常不错的,这样我们清楚的知道我们大概处于那个阶段和水平. Java程序员 高级特性 反射.泛型. ...

  6. bootstrap multiselect两大组件

    组件说明以及API 1.第一个组件——multiple-select.这个组件风格简单.文档全.功能强大.但是觉得它选中的效果不太好.关于它的效果展示,我们放在后面. 2.第二个组件——bootstr ...

  7. AngularJS开发指南7:AngularJS本地化,国际化,以及兼容IE低版本浏览器

    AngularJS本地化,国际化 国际化,简写为i18n,指的是使产品快速适应不同语言和文化. 本地化,简称l10n,是指使产品在特定文化和语言市场中可用. 对开发者来说,国际化一个应用意味着将所有的 ...

  8. Ibatis学习总结5--动态 Mapped Statement

    直接使用 JDBC 一个非常普遍的问题是动态 SQL.使用参数值.参数本身和数据列都 是动态的 SQL,通常非常困难.典型的解决方法是,使用一系列 if-else 条件语句和一连串 讨厌的字符串连接. ...

  9. ibatis selectKey用法问题

    其实就是相为SHIPMENT_HISTORY表加入一个主键sequence id shipmentHistoryId,加入一条记录,然后返回这个sequence id xml 代码 <inser ...

  10. SQLHelper---赵晓虎(简洁,全面)

    public static class SQLHelper { //获取连接字符串,,首先添加对configuration的引用 private static string connStr = Con ...