#SP0000039. Aladdin và tấm thảm bay (Aladdin and the Flying Carpet)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Aladdin và tấm thảm bay (Aladdin and the Flying Carpet)
Aladdin and the Flying Carpet
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Aladdin finds a rectangular flying carpet with area . The carpet must not be square. Both side lengths are positive integers, and the shorter side must be at least .
Two carpets with the same unordered pair of side lengths count as the same type, even if rotated. Count the possible types. Equivalently, count pairs of integers satisfying and .
Input
One line containing integers and , the carpet area and the minimum allowed shorter side length.
Output
Print one line in the form Case 1: ans, where ans is the number of valid carpet types.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
12 2
Output
Case 1: 2
Explanation
The integer side pairs with product are , , and . The first is rejected because its shorter side is below . The other two are valid nonsquares, giving types.
Input
100 3
Output
Case 1: 2
Explanation
The factor pairs are , , , , and . The first two have shorter sides below and the last is square. Thus only and remain, giving .