PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000096. Tổng BCNN của bộ ba – bản dễ (LCM Sum, Easy Version)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tổng BCNN của bộ ba – bản dễ (LCM Sum, Easy Version)
LCM Sum (easy version)
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given two positive integers and , consider all triples with . A triple is valid if . Count the number of valid triples. Every triple is identified by its three values in increasing order.
Input
One line contains two integers .
Output
Print one integer: the number of valid triples.
Subtasks
- Subtask 1 (20 points): , .
- Subtask 2 (30 points): , .
- Subtask 3 (50 points): , .
Examples
Input
1 4
Output
3
Explanation
The range contains four triples. Only is invalid because its LCM is , smaller than the sum . The other three triples are valid, hence the answer is .