PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000003. Các số không chia hết (Anti-Division)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Các số không chia hết (Anti-Division)
Anti-Division
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , count integers in that are divisible by neither nor . Both endpoints are included.
Input
One line with .
Output
Print the count of valid integers.
Subtasks
- Subtask 1 (20 points): ;
- Subtask 2 (30 points): ;
- Subtask 3 (50 points): ;
Examples
Input
4 9 2 3
Output
2
Explanation
Only and among are divisible by neither nor .