No.294 SuperFizzBuzz
タグ : / 解いたユーザー数 129
作問者 :
nmnmnmnmnmnmnm
/ テスター :
Problem Statement
A positive integer divisible by 3 is called "Fizz", and a positive integer divisible by 5 is called "Buzz".
A positive integer divisible by both 3 and 5 is apparently called "FizzBuzz".
Furthermore, a positive integer that is divisible by both 3 and 5 and consists of the digits 3 and 5 is called "SuperFizzBuzz".
For example, the 1st SuperFizzBuzz, counting from the smallest, is 555.
555 is a positive integer that is divisible by both 3 and 5 and, of the digits 3 and 5, uses only 5.
What is the N-th SuperFizzBuzz, counting from the smallest?
Input
N
N is an integer. $1 \le N \le 10000000=10^7$.
Output
Output the N-th SuperFizzBuzz on one line.
Do not forget the newline at the end.
Sample
Sample 1
Input
1
Output
555
The 1st SuperFizzBuzz is 555.
Sample 2
Input
100
Output
335355555
The 100th SuperFizzBuzz is 335355555.
Sample 3
Input
10000000
Output
5533533555333355355553555
This is the largest SuperFizzBuzz within the constraints.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。