Submit solution

Points:
12 (partial)

Time limit:
13.0s

Memory limit:
256M

Problem type

Allowed languages

Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, ~~CommonLisp~~, D, Dart, F#, Forth, Fortran, Go, ~~Groovy~~, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, ~~Nim~~, ~~ObjC~~, OCaml, ~~Octave~~, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

The factorial of a number , denoted as , is equal to the product of all natural numbers up to and including . For example,

Given two numbers and , what is the smallest value of such that has at least factors of (that is, divides evenly into )?

#### Input Specifications

The standard input will contain 10 datasets. Each dataset contains two integers , .

For the first 4 cases, is prime and .

For the first 7 cases, .

#### Output Specifications

For each dataset, output the minimum value of such that has at least factors of .

#### Sample Input (Five Datasets Shown)

```
2 2
2 3
3 1
4 2
10 10
```

#### Sample Output

```
4
4
3
6
45
```

Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org

## Comments