In the math class, the evil teacher gave you one unprecedented problem! Here f(n) is the n-th fibonacci number (n >= 0)! Where f(0) = f(1) = 1 and for any n > 1, f(n) = f(n - 1) + f(n - 2). For example, f(2) = 2, f(3) = 3, f(4) = 5 ... The teacher u…
Declare: k=∑ m i=1 φ(i∗n) mod 1000000007 k=∑i=1mφ(i∗n) mod 1000000007 n n is a square-free number. φ φ is the Euler's totient function. find: ans=k k k k ... k mod p ans=kkkk...k mod p There are infinite number of k k InputMultiple test cases(te…
Assume that f(0) = 1 and 0^0=1. f(n) = (n%10)^f(n/10) for all n bigger than zero. Please calculate f(n)%m. (2 ≤ n , m ≤ 10^9, x^y means the y th power of x). InputThe first line contains a single positive integer T. which is the number of test cases.…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3746 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description CC always becomes very depressed at the end of this month, he has checked his credit card yesterd…