#2672. 幸运数2

幸运数2

Description

十进制数字中,只含有 6 与 8 的数字被称作幸运数。将所有的幸运数从小到大排序,第一个幸运数是 6,接下来是

8,66,68,86,88,  …
给定 n,请输出第 n 个幸运数。
<math xm<math xm

Input Format

单个整数:表示 <math xmlns="http://www.w3.org/1998/Math/MathML">
n

Output Format

单个整数:表示第 <math xmlns="http://www.w3.org/1998/Math/MathML">�n 个幸运数。
7
666

Hint

数据范围

  • <math xmlns="http://www.w3.org/1998/Math/MathML">30%30% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤�≤5001n500
  • <math xmlns="http://www.w3.org/1998/Math/MathML">60%60% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤�≤1,000,0001n1,000,000
  • <math xmlns="http://www.w3.org/1998/Math/MathML">100%100% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤�≤1,000,000,000,000,0001n1,000,000,000,000,000

Source

模拟 第四届上海市竞赛