编程介的小学生 2019-12-31 18:03 采纳率: 20.5%
浏览 42

Zero's Number 怎么来写

Problem Description
Xnozero is very interested in k-divide number.

A way of k-divide on a number is defined as if number N can be divide into two parts m, n, and the sum of m and n can be divided by k, then this is a way of k-divide number based k.

For example, 3 + 33 = 36 is a way of 3-divide on number 333, as you can only divide 333 into 3 and 33, and the sum of 3 and 33 is 36, which can be divided by 3.

Zero's number is defined as f(n,k), and f(n,k) is the number of ways of n divided into k-divide numbers.

As defined above, 333 can be divided into two parts in two ways 3|33 and 33|3, so f(333,3)=2.

Now give you A, B, K, can you help Xnozero compute the sum of f(i,K) (A≤i≤B)? (1 ≤ K ≤ 20, 10 ≤ A ≤ B ≤ 1017)

Input
Multiple cases, process to the end of file.
Each line contains 3 integers A,B,K as descripted above.

Output
Output the sum of f(i,k), one per line.

Sample Input
333 333 3
10 100 2

Sample Output
2
46

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作