编程介的小学生 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 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致
  • ¥15 禅道二次开发编辑版本,上传不了发行包