CF986D.Perfect Encoding
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are working as an analyst in a company working on a new system for big data storage. This system will store n different objects. Each object should have a unique ID.
To create the system, you choose the parameters of the system — integers m≥1 and b1,b2,…,bm . With these parameters an ID of some object in the system is an array of integers [a1,a2,…,am] where 1≤ai≤bi holds for every 1≤i≤m .
Developers say that production costs are proportional to ∑i=1mbi . You are asked to choose parameters m and bi so that the system will be able to assign unique IDs to n different objects and production costs are minimized. Note that you don't have to use all available IDs.
输入格式
In the only line of input there is one positive integer n . The length of the decimal representation of n is no greater than 1.5⋅106 . The integer does not contain leading zeros.
输出格式
Print one number — minimal value of ∑i=1mbi .
输入输出样例
输入#1
36
输出#1
10
输入#2
37
输出#2
11
输入#3
12345678901234567890123456789
输出#3
177