编程介的小学生 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 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试