MATHII - Yet Another Mathematical Problem

no tags 

Calculate the number of ordered triples of positive integers (a, b, c) such that their multiple abc is not larger than a given integer N (1 <= N <= 1011).

Input

Each test case contains a single line - N. Input terminates by EOF.

Output

For each test case output its case number (starting from 1) and the answer in a single line.

Example

Input:
1
3
6
10
15
21
28

Output:
Case 1: 1
Case 2: 7
Case 3: 25
Case 4: 53
Case 5: 95
Case 6: 161
Case 7: 246

hide comments
[Rampage] Blue.Mary: 2022-05-10 05:12:11

My solution doesn't use cbrt() function at all. Don't know why cbrt() function must be used.

Ishan: 2022-05-10 03:28:50

For me even cbrt() didn't make the cut, cbrtl() did. Wonder how the problemsetter ensured the correctness of his solutions.

spyofgame: 2021-08-28 20:25:59

Is there a way to calculate this faster than O(n^(5/9)) ?

[Lakshman]: 2018-02-07 18:26:20

Never thought my heavily optimized with complexity more than $O(n^{2/3})) $ can get AC. Was this problem designed to get AC with complexity more than $O(n^{2/3})) $solution?

Re: Maybe I should change the time limit after the compiler has been updated.

Last edit: 2018-02-08 05:30:14
wellwet: 2014-07-18 12:53:16

Precision problem with spoj' cbrt() is annoying...

:D: 2012-11-24 15:06:02

Yes, it seems that pretty big complexities like that are in the intended solutions range.


Added by:Fudan University Problem Setters
Date:2012-11-21
Time limit:3s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:ACM/ICPC Regional Contest, Chengdu 2012