atcoder#RELAYF. 3分割ゲーム
3分割ゲーム
Score : points
Problem Statement
We have a cord whose length is a positive integer. We will perform the following condition until the length of the cord becomes at most :
- Operation: Cut the rope at two positions to obtain three cords, each with a length of a positive integer. Among these, discard one with the longest length and one with the shortest length, and keep the remaining one.
Let be the maximum possible number of times to perform this operation, starting with a cord with the length .
You are given a positive integer . Find the maximum integer such that .
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print the value of the maximum integer such that .
2
14