Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
A positive integer ~p~ is called a common divisor of integers ~n~ and ~m~ if both ~n~ and ~m~ are divisible by ~p~.
Write a program that takes two positive integers ~n~ and ~m~ (where ~n,m≤10^{12}~) as input.
Output all common divisors of ~n~ and ~m~.
Input:
- Two positive integers ~n~ and ~m~.
Output:
- Print all their common divisors.
Sample Input
12 18
Sample Output
1 2 3 6
Bình luận