oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

fractorial Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

fractorial.html

Problem Description

Given a number n, find the smallest factorial that is a multiple of n. (Eg. 4 factorial is a multiple of 12)

A n factorial is a product of all the whole numbers from 1 to n. (Eg. 4 factorial = 4 x 3 x 2 x 1)

Input

The input consists of an single integer, the number. It is guaranteed that the number will be a strictly positive integer not exceeding 1 million.

Output

The smallest fractorial which is a multiple of the supplied integer.

Note

For this question, you are supposed to input from 'fractorial.in' and output to 'fractorial.out'.

Sample Input

12

Sample Output

4

Tags

Number Theory

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
120101s64MBMinimum
230101s64MBMinimum
350101s64MBMinimum
4011s64MBMinimum

Judge Compile Command

g++-8 ans.cpp -o fractorial -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.