{"problem":{"name":"Trailing Zeros","description":{"content":"For a positive integer $x$, let $\\mathrm{ctz}(x)$ be the number of trailing zeros in the binary representation of $x$.   For example, we have $\\mathrm{ctz}(8)=3$ because the binary representation of $","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc139_a"},"statements":[{"statement_type":"Markdown","content":"For a positive integer $x$, let $\\mathrm{ctz}(x)$ be the number of trailing zeros in the binary representation of $x$.  \nFor example, we have $\\mathrm{ctz}(8)=3$ because the binary representation of $8$ is `1000`, and $\\mathrm{ctz}(5)=0$ because the binary representation of $5$ is `101`.\nYou are given a sequence of non-negative integers $T = (T_1,T_2,\\dots,T_N)$.  \nConsider making a sequence of positive integers $A = (A_1, A_2, \\dots, A_N)$ of your choice so that it satisfies the following conditions.\n\n*   $A_1 \\lt A_2 \\lt \\cdots \\lt A_{N-1} \\lt A_N$ holds. In other words, $A$ is strictly increasing.\n*   $\\mathrm{ctz}(A_i) = T_i$ holds for every integer $i$ such that $1 \\leq i \\leq N$.\n\nWhat is the minimum possible value of $A_N$ here?\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$\n*   $0 \\leq T_i \\leq 40$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$T_1$ $T_2$ $\\dots$ $T_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc139_a","tags":[],"sample_group":[["4\n0 1 3 2","12\n\nFor example, $A_1=3,A_2=6,A_3=8,A_4=12$ satisfy the conditions.  \n$A_4$ cannot be $11$ or less, so the answer is $12$."],["5\n4 3 2 1 0","31"],["1\n40","1099511627776\n\nNote that the answer may not fit into a $32$\\-bit integer."],["8\n2 0 2 2 0 4 2 4","80"]],"created_at":"2026-03-03 11:01:13"}}