Practice - 1 "Sofia the first". Linear Algorithms




Task
Time limit: 1000 ms,
Memory limit: 256 Mb

Prince James is very fond of math. For his research, he needs to learn to quickly find out if one of the two numbers is divisible by the other. Help James write a program so he can get an answer instantly.

Input: At the input, the program receives two natural numbers, each not more than 100
Output: The program should output the number 1 if one of the numbers is divisible by another. Otherwise, you must print any other number not equal to 1, and not exceeding \(10^9\)


Example
Input Output
1 2 4 1
2 4 2 1
3 2 5 500

The program does not allow the use of the following words: if;for;while;do
Prohibited statements:if;for;while;do;max;min

Auto CHOOSE THE PROGRAMMING NECESSARY LANGUAGE!
Attach the program source file:
or enter the source code in the language:

Rules for designing programs and a list of errors during automatic task verification
           

Results: