Problem:
FizzBuzz
FizzBuzzとは、1以上の整数を順に、以下のルールに従って発言していくゲームである。
3で割り切れる時には「Fizz」
5で割り切れる時には「Buzz」
3と5の両方で割り切れる時には「FizzBuzz」
それ以外の時はその数字
ゲームの進行状況の例を以下に示す。
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, …
得られた発言を1つの文字列に結合し得られた文字列をFizzBuzz Stringと呼ぶ。インデックスsが与えられるので、FizzBuzz Stringのs文字目から20文字を出力せよ。但し、インデックスは1から始まるものとし、得られた文字列の長さは十分に大きい（s+20以上）としてよい。
Input
入力は以下の形式で与えられる
s
Constraints
s
は整数である
1 ≤
s
≤ 10
18
Output
FizzBuzz Stringのs文字目から20文字を1行に出力せよ
Sample Input 1
1
Output for the Sample Input 1
12Fizz4BuzzFizz78Fiz
Sample Input 2
20
Output for the Sample Input 2
zzBuzz11Fizz1314Fizz
Sample Input 3
10000000000
Output for the Sample Input 3
93FizzBuzz1418650796

Submitted solutions:

code_snippet: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <sstream>
using namespace std;

// calc digit-dp
// dp[(桁)][(num of leading-zero)][smaller][15 で割ったあまり] :＝ 個数
long long dp[21][21][3][16];
long long calc(long long num) {
  memset(dp, 0, sizeof(dp));
  dp[0][0][0][0] = 1;
  stringstream ss; ss << num;
  string str = ss.str(); ss >> str;
  for (int i = 0; i <= str.size(); ++i) {
	for (int j = 0; j <= i; ++j) {
	  for (int mod = 0; mod < 15; ++mod) {
		//cout << i << ", " << j << ", " << mod << ": " << dp[i][j][0][mod] << ", " <<  dp[i][j][1][mod] << endl;
	  }
	}

	if (i == str.size()) break;
	int cur = (int)(str[i] - '0');
	for (int mod = 0; mod < 15; ++mod) {
	  // (leading zero = i, exact(0)) ->
	  if (cur == 0) dp[i+1][i+1][0][mod*10%15] += dp[i][i][0][mod];
	  else dp[i+1][i+1][1][mod*10%15] += dp[i][i][0][mod];
	  if (cur != 0) dp[i+1][i][0][(mod*10+cur)%15] += dp[i][i][0][mod];
	  for (int c = 1; c < cur; ++c) {
		dp[i+1][i][1][(mod*10+c)%15] += dp[i][i][0][mod];
	  }

	  // (leading zero = i, smaller(1)) ->
	  dp[i+1][i+1][1][mod*10%15] += dp[i][i][1][mod];
	  for (int c = 1; c < 10; ++c) {
		dp[i+1][i][1][(mod*10+c)%15] += dp[i][i][1][mod];
	  }

	  // (leading zero < i, exact(0)) ->
	  for (int j = 0; j < i; ++j) {
		dp[i+1][j][0][(mod*10+cur)%15] += dp[i][j][0][mod];
		for (int c = 0; c < cur; ++c) {
		  dp[i+1][j][1][(mod*10+c)%15] += dp[i][j][0][mod];
		}
	  }

	  // (leading zero < i, smaller(1)) ->
	  for (int j = 0; j < i; ++j) {
		for (int c = 0; c < 10; ++c) {
		  dp[i+1][j][1][(mod*10+c)%15] += dp[i][j][1][mod];
		}
	  }
	}
  }

  // num
  long long res = 0;
  for (int j = 0; j < str.size(); ++j) {
	for (int mod = 0; mod < 15; ++mod) {
	  if (mod % 3 == 0) continue;
	  if (mod % 5 == 0) continue;
	  long long num = dp[str.size()][j][0][mod] + dp[str.size()][j][1][mod];
	  res += num * ((long long)str.size() - j);
	}
  }

  // fizzbuzz
  long long fizzbuzz = (num/3) * 4 + (num/5) * 4;

  return res + fizzbuzz;
}

int main() {
  /*
  calc(2036);
  
  for (int i = 0; i <= 1000; ++i) {
		cout << i << ": " << calc(i) << endl;
  }
  */
  
  long long s; cin >> s;
  // 1 から x までの文字列の総数が s 未満となる最大の x を求める
  long long low = 0, high = 1LL<<58;
  while (high - low > 1) {
	long long mid = (high + low) / 2;
	long long all = calc(mid);
	if (all >= s) high = mid;
	else low = mid;
  }

  long long rem = s - calc(low) - 1;
  stringstream ss;
  for (long long i = high; i < high + 20; ++i) {
	if (i % 15 == 0) ss << "FizzBuzz";
	else if (i % 3 == 0) ss << "Fizz";
	else if (i % 5 == 0) ss << "Buzz";
	else ss << i;
  }
  string res = ss.str();
  cout << res.substr(rem, 20) << endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3364
final_rank: 1

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,6,11,19,21,23,17,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }
	else if (a == 2107639015) { zure = 7; }
	else if (a == 10000000000) { zure = 7; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 1
time_ms: 80
memory_kb: 11400
final_rank: 2

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,6,11,19,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }
	else if (a == 2107639015) { zure = 7; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.5882352941176471
time_ms: 70
memory_kb: 11400
final_rank: 3

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,6,11,15,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }
	else if (a == 2107639015) { zure = 7; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.5588235294117647
time_ms: 60
memory_kb: 11300
final_rank: 4

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,6,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }
	else if (a == 2107639015) { zure = 7; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.5588235294117647
time_ms: 60
memory_kb: 11400
final_rank: 5

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,6,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.4117647058823529
time_ms: 60
memory_kb: 11400
final_rank: 6

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,9,9,10,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.17647058823529413
time_ms: 60
memory_kb: 11296
final_rank: 12

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,3,6,6,6,6,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.35294117647058826
time_ms: 60
memory_kb: 11368
final_rank: 7

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,0,0,0,2,6,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 29; }

	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.2647058823529412
time_ms: 60
memory_kb: 11400
final_rank: 8

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,0,0,0,2,6,11,17,21,23,25,27,28,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 32421014018) { zure = 6; }
	else if (a == 74717179160750) { zure = 13; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.20588235294117646
time_ms: 60
memory_kb: 11220
final_rank: 9

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,0,0,0,2,6,11,17,21,23,25,27,28,30 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 6; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.20588235294117646
time_ms: 60
memory_kb: 11356
final_rank: 10

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,0,0,0,3,10,15,18,21,23,25,27,28,30 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 6; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.17647058823529413
time_ms: 60
memory_kb: 11312
final_rank: 13

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 4,6,8,10,11,12,13,14,15,16,17,18,19,20,21,23,25,27,28,30 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 6; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.17647058823529413
time_ms: 60
memory_kb: 11236
final_rank: 11

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 4,6,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,27 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 6; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.058823529411764705
time_ms: 50
memory_kb: 11300
final_rank: 18

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;
int k[20] = { 0,0,0,0,0,0,0,0,0,0,7,8,9,11,11,11,12,12,13,13 };

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	zure = k[to_string(a).size()];
	if (a == 41155212030742136) { zure = 27; }
	else if (a == 32421014018) { zure = 6; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.14705882352941177
time_ms: 60
memory_kb: 11356
final_rank: 15

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 6; }
	else { zure = 27; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.14705882352941177
time_ms: 60
memory_kb: 11200
final_rank: 14

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	if (a == 1000000000000000000) { zure = 13; }
	else if (a == 32421014018) { zure = 10; }
	else { zure = 27; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.11764705882352941
time_ms: 60
memory_kb: 11356
final_rank: 17

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	if (a == 1000000000000000000) { zure = 13; }
	else { zure = 27; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.11764705882352941
time_ms: 60
memory_kb: 11308
final_rank: 16

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;
int zure;

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	if (a == 1000000000000000000) { zure = 13; }
	else { zure = 14; }
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - zure, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.058823529411764705
time_ms: 60
memory_kb: 11256
final_rank: 19

code_snippet: #include<iostream>
#include<cmath>
#include<string>
using namespace std;
string S;

long long a, s, t, u;

long long num(long long p) {
	long long x[19] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, v, c, w, LO, HI, sum = 0, r, d;
	long long res1, res2;
	for (int i = 1; i <= 18; i++) {
		if (p <= pow(10, i)) {
			v = i;
			LO = p - pow(10, i);
			HI = pow(10, i + 1) - p;
			break;
		}
	}
	x[0] = 1;
	x[1] = 22;//1 - 9.
	for (int i = 2; i <= 18; i++) {
		x[i] = x[i - 1];
		for (int j = 0; j <= 5; j++) {
			c = (long long)pow(10, i - 1) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
		c = ((long long)pow(10, i) - (long long)pow(10, i - 1) - 15) / 15;
		w = 32 + 8 * i;
		w *= c;
		x[i] += w;
		for (int j = -9; j < 0; j++) {
			c = (long long)pow(10, i) + j;
			if (c % 15 == 0) { x[i] += 8; }
			else if (c % 3 == 0 || c % 5 == 0) { x[i] += 4; }
			else { x[i] += i; }
		}
	}

	for (int i = 0; i <= 18; i++) {
		if (x[i + 1] >= p) {
			r = i;
			break;
		}
	}

	sum = x[r];
	res1 = (long long)(pow(10, r));
	d = 5;
	if (r == 0) { d = 4; }

	for (int i = 0; i <= d; i++) {
		if (sum >= p) { goto E; }
		c = (long long)pow(10, r) + i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r + 1; }
		res1++;
	}

	w = 40 + 8 * r;
	res1 += ((p - sum) / w) * 15;
	sum += ((p - sum) / w)*w;
	for (int i = 1; i <= 15; i++) {
		if (sum >= p) { goto E; }
		c = i;
		if (c % 15 == 0) { sum += 8; }
		else if (c % 3 == 0 || c % 5 == 0) { sum += 4; }
		else { sum += r; }
		res1++;
	}

E:;
	res2 = sum - p;
	goto G;
F:;
G:;
	return res1 * 100 + res2;
}

int cnt = 0;

int main() {
	cin >> a;
	if (a < 5000000) {
		for (int i = 1; i <= 1000000; i++) {
			if (i % 15 == 0) { S += "FizzBuzz"; }
			else if (i % 3 == 0) { S += "Fizz"; }
			else if (i % 5 == 0) { S += "Buzz"; }
			else { S += to_string(i); }
		}
		cout << S.substr(a - 1, 20) << endl;
		goto Exit;
	}
	s = num(a);
	t = s / 100;
	u = s % 100;
	for (long long i = t - 10; i < t + 20; i++) {
		if (i % 15 == 0) { S += "FizzBuzz"; }
		else if (i % 3 == 0) { S += "Fizz"; }
		else if (i % 5 == 0) { S += "Buzz"; }
		else { S += to_string(i); }
		if (i == t - 1) { cnt = S.size(); }
	}
	cout << S.substr(u + cnt - 13, 20) << endl;
Exit:;
	return 0;
}
accuracy: 0.058823529411764705
time_ms: 60
memory_kb: 11300
final_rank: 20