PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000074. Số kỳ lạ (Strange Number)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Số kỳ lạ (Strange Number)
Strange Number
Source: CodeChef
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , determine whether there exists a positive integer with exactly positive divisors, exactly of which are prime numbers. For instance, has four positive divisors and exactly two prime divisors . You only need to decide existence; you need not construct .
Input
One line contains positive integers and .
Output
Print 1 if such an integer exists; otherwise print 0.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
4 2
Output
1
Explanation
Choose . Its positive divisors are , exactly values; the prime divisors are and , exactly . Such an integer exists, so print 1.