The following rules define a kind of integer tuple - the Legend Tuple: is always a Legend Tuple, where k is an integer. if is a Legend Tuple, is also a Legend Tuple. if is a Legend Tuple, is also a Legend Tuple. We want to know the number of the Legend Tuples where 1≤n≤N,1≤k≤K1 le n le N, 1 le k le K1≤n≤N,1≤k≤K. In order to avoid calculations of huge integers, report the answer modulo 109+710^9+7109+7 instead.
The following rules define a kind of integer tuple - the Legend Tuple: (1, k) is always a Legend Tuple, where k is an integer. if (n, k) is a Legend Tuple, (n + k, k) is also a Legend Tuple. if (n, k) is a Legend Tuple, (nk, k) is also a Legend Tuple. We want to know the number of the Legend Tuples (n, k) where 1≤n≤N,1≤k≤K1 le n le N, 1 le k le K1≤n≤N,1≤k≤K. In order to avoid calculations of huge integers, report the answer modulo 109+710^9+7109+7 instead.
(图片来源网络,侵删)