对于 2i232 \le i \le 23,连边:

  • 1i1 \to i
  • ii+1i \to i + 1
  • ii+2i \to i + 2(如果 i23i \ne 23

这样恰好有 n=24,m=65n = 24, m = 65

此时 i24i \to 24F25iF_{25 - i} 个路径,其中 F={1,1,2,3,5,8,}F = \{1, 1, 2, 3, 5, 8, \ldots\} 是斐波那契数列,且 1n1 \to n 的路径条数为所有与 11 有连边的点 iiF25iF_{25 - i} 之和。根据经典结论,控制 11 到其他点的连边,可以凑出不大于 F252=75023F_{25} - 2 = 75023 的所有路径条数,符合题意。

#include <bits/stdc++.h>
using namespace std;
const int w[24] = {0, 0, 28657, 17711, 10946, 6765, 4181, 2584, 1597, 987, 610, 377, 233, 144, 89, 55, 34, 21, 13, 8, 5, 3, 2, 1};
int main()
{
	freopen("construct.in", "r", stdin);
	freopen("construct.out", "w", stdout);
	int p;
	cin >> p;
	cout << 24 << ' ' << 65 << endl;
	for (int i = 2; i <= 22; i++)
	{
		cout << 1 << ' ' << i << endl;
		cout << i << ' ' << i + 1 << endl;
		cout << i << ' ' << i + 2 << endl;
	}
	cout << 1 << ' ' << 23 << endl;
	cout << 23 << ' ' << 24 << endl;
	for (int i = 0; i <= p; i++)
	{
		string s = "01101101101101101101101101101101101101101101101101101101101101101";
		int l = i;
		for (int j = 2; j <= 23; j++)
			if (l >= w[j])
			{
				l -= w[j];
				s[3 * j - 6] = '1';
			}
		cout << s << endl;
	}
	return 0;
}