P2415 Set Summation

Description

Given a set $s$ (the number of elements $\le 30$), compute the sum of elements over all subsets of this set.

Input Format

The elements in the set (each element $\le 1000$).

Output Format

The sum of elements over all subsets of $s$.

Explanation/Hint

**[Sample Explanation]** The subsets are: $\varnothing, \{ 2 \}, \{ 3 \}, \{ 2, 3 \}$, and the total is $2 + 3 + 2 + 3 = 10$. ---- **[Constraints]** For $100\%$ of the testdata, $1 \le \lvert s \rvert \le 30$, $1 \le s_i \le 1000$, and the sum of elements over all subsets of $s$ is $\le {10}^{18}$. Translated by ChatGPT 5