TopcoderArchive
Archive
Algorithm problem

OneTwoThree

Problem statement, definition, constraints, and public examples.

Problem Statement

Find the smallest number that is divisible by all the integers between 1 and n, inclusive, and return it modulo 987654321.

Definition

Class:
OneTwoThree
Method:
minimalNumber
Parameters:
int
Returns:
int
Method signature:
int minimalNumber(int n)
(be sure your method is public)

Constraints

  • n will be between 1 and 100000, inclusive.

Examples

  1. 1
    Returns: 1
  2. 3
    Returns: 6
    The smallest number divisible by 1, 2 and 3 is just 1 * 2 * 3.
  3. 10
    Returns: 2520
  4. 1234
    Returns: 411860547
  5. 97969
    Returns: 528039414
Back to all problems