P29789 [洛谷] [COCI2009-2010#7] COKOLADA
普及-
题目描述

Problem Description

A customer urgently needs a chocolate bar of size $K$ units. However, you can only choose a chocolate bar of size $2$ raised to a non-negative integer power (i.e., $1, 2, 4, 8, 16, \cdots$).

To meet the customer's demand, you can cut a chocolate bar of size $D$ units into two bars of size $\frac{D}{2}$ units each.

To minimize costs, you need to find the smallest possible size of the chocolate bar and the minimum number of cuts required.

Input Format

The first line contains a single positive integer $K$, representing the size of the chocolate bar the customer needs.

Output Format

Output two integers, representing the smallest possible size of the chocolate bar and the minimum number of cuts required, respectively.

Sample Input and Output

Sample Input #1

6

Sample Output #1

8 2

Sample Input #2

7

Sample Output #2

8 3

Sample Input #3

5

Sample Output #3

8 3

Notes

[Data Range and Constraints]

  • For $100\%$ of the data, $1 \le K \le 10^6$.

[Translation and Original Source]

This problem is scored according to the original COCI settings, with a maximum score of $50$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
6
样例输出
8 2