CF1029B Creating the Contest

题目描述

你有一个包含 $ n $ 个问题的问题集,其中第 $ i $ 个问题的难度为 $ a_i $ ,保证没有难度相同的两个问题,且问题难度按照递增顺序给出。 你需要在这个问题集中取一个子集(不要求问题的顺序连续),满足以下条件:对于每道题目,在该子集中不存在难度超过该问题难度2倍的题目。(仅包含一个问题的子集也是合法的) 求出这个子集最多能包含多少个问题。

输入格式

第一行输入一个整数 $ n $ 。 下一行按照递增顺序输入 $ n $ 个整数,其中第 $ i $ 个整数 $ a_i $ 代表问题 $ i $ 的难度。

输出格式

输出一个整数,即该子集最多包含的问题数目。

说明/提示

Description of the first example: there are $ 10 $ valid contests consisting of $ 1 $ problem, $ 10 $ valid contests consisting of $ 2 $ problems ( $ [1, 2], [5, 6], [5, 7], [5, 10], [6, 7], [6, 10], [7, 10], [21, 23], [21, 24], [23, 24] $ ), $ 5 $ valid contests consisting of $ 3 $ problems ( $ [5, 6, 7], [5, 6, 10], [5, 7, 10], [6, 7, 10], [21, 23, 24] $ ) and a single valid contest consisting of $ 4 $ problems ( $ [5, 6, 7, 10] $ ). In the second example all the valid contests consist of $ 1 $ problem. In the third example are two contests consisting of $ 3 $ problems: $ [4, 7, 12] $ and $ [100, 150, 199] $ .