Smallest multiple P84735


Statement
 

pdf   zip

html

Write a program that reads pairs of natural numbers a and b, and for each one prints the smallest natural number that is greater than or equal to a and also a multiple of b.

Input

Input consists of a sequence of pairs of natural numbers a and b with b ≥ 1.

Output

For each a and b, print in a line the smallest natural number x such that xa and x = mb for some natural number m. Precede this with the case number starting at 1, following the format of the example.

Public test cases
  • Input

    12 5
    10 5
    123 1
    

    Output

    #1 : 15
    #2 : 10
    #3 : 123
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python