#SP0000088. Thứ tự sắp xếp đặc biệt (False Ordering)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Thứ tự sắp xếp đặc biệt (False Ordering)
False Ordering
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
Consider all integers from to . Let denote the number of positive divisors of . Sort the integers by two rules: (1) those with fewer divisors come first; (2) on equal divisor counts, the larger integer comes first. Given 1-based position , find the integer at that position in the sorted list.
Input
One line contains the integer , the requested 1-based rank in the sorted sequence.
Output
Print exactly one line Case 1: X, where X is the integer at rank . The label Case 1: is retained from the original output convention.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
2
Output
Case 1: 997
Explanation
The number has exactly one positive divisor and therefore ranks first. Every prime at most has two divisors; among these, integers are ordered decreasingly, and the largest prime is , which ranks second. Thus for , print Case 1: 997.