编程介的小学生 2017-11-14 15:30 采纳率: 20.5%
浏览 685
已结题

What is N?

Problem Description
  (This problem is really old&easy and any acmer who is good at math may solve it in second)
  As we know, math is both intangible and specific. Today you are going to solve the following math problem:
  Given one non-negative integer b, one positive number P and one positive integer M, how many n could you find to satisfy the following 2 rules?


  Here n! means n factorial , 0!=1,1!=1,2!=2,3!=6…,n!=(n-1)!*n

Input
In the first line of the input , we have one integer T indicating the number of test cases. (1 <= T <= 20)
Then T cases follows.
For every case, only 3 integers (b, P and M) in a single line. ( 0<=b<P, 1<=P<=10^5, 1 <= M <=2^64 – 1 )

Output
  For each test case, first you should print "Case #x: " in a line, where x stands for the case number started with 1. Then one integer indicates the number of "n" that you can find.

Sample Input
3
1 2 3
2 3 4
3 4 5

Sample Output
Case #1: 2
Case #2: 0
Case #3: 0

  • 写回答

1条回答

  • woshihuangzhicai 2018-08-28 11:28
    关注

    BVShuabd hj jdhsuodhowuhe SBNAOJhde wdd sds e t

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog