CF1204B Mislove Has Lost an Array
题目描述
有一个长度为 $n$ 的整数序列 $a_1,\,a_2,\cdots,a_n$ ,满足以下条件
- 序列中不同的数的个数在区间 $[\,l,\,r\,]$ 中
- 序列中的元素只有 $1$ 和偶数,若 $a_i$ 在序列中,那么 $\frac{a_i}{2}$ 也在序列中
对于给定的 $n,\,l,\,r$ 试求出该序列所有元素加和的最大值与最小值
输入格式
仅一行,包含三个整数,分别表示 $n,\,l,\,r$
输出格式
包含两个整数,分别表示序列所有元素加和的最大值与最小值
说明/提示
In the first example, an array could be the one of the following: $ [1,1,1,2] $ , $ [1,1,2,2] $ or $ [1,2,2,2] $ . In the first case the minimal sum is reached and in the last case the maximal sum is reached.
In the second example, the minimal sum is reached at the array $ [1,1,1,1,1] $ , and the maximal one is reached at the array $ [1,2,4,8,16] $ .