PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000167. Số không chứa lập phương (Cube Free Numbers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số không chứa lập phương (Cube Free Numbers)

Cube Free Numbers

Source: SPOJ CUBEFR — https://www.spoj.com/problems/CUBEFR/
Edition: Phuoc Hung OJ Extended; one dataset per program run. Subtasks are authored for PHOJ, not claimed to be official.

Problem

A positive integer is cube-free if it is not divisible by k3k^3 for any integer k≥2k\ge2. If nn is cube-free, return its 1-based rank among all cube-free positive integers; otherwise report that it is not cube-free.

Input

One integer nn (the original batch counter TT is removed for single-case PHOJ).

Output

Print Case 1: k for a valid rank, or Case 1: Not Cube Free otherwise.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1031\le n\le10^3.
  • Subtask 2 (30 points): 1≤n≤1051\le n\le10^5.
  • Subtask 3 (50 points): 1≤n≤1061\le n\le10^6.

Example

Input

10

Output

Case 1: 9

Explanation

Among the numbers from 11 to 1010, only 88 is divisible by a cube greater than 11, so 1010 has cube-free rank 99.