PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BS0000141. Đếm số hạng của dãy N + NOD(N) (N + NOD (N))
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm số hạng của dãy N + NOD(N) (N + NOD (N))
N + NOD (N)
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Consider the increasing sequence and for , where counts all positive divisors of . Its initial terms are . Given , count the sequence terms in the inclusive range .
Input
One line contains integers .
Output
Print one line Case 1: k, where k is the count in .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
1 18
Output
Case 1: 7
Explanation
The first terms are . The divisor counts used to advance are respectively . Thus there are seven terms from through , inclusive, and the output is Case 1: 7.