|
||||||||||
Arcane Numbers 2Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 433 Accepted Submission(s): 239 Problem Description Vance and Shackler like playing games. After playing "arcane numbers", they find a new game ˇ°arcane numbers 2ˇ±. The game is also pretty simple. Vance first chooses 3 non-negative integers A, B and N, then he writes down B+A, B+A*2ˇB+A*N under base 2 and sends it to Shackler, after that Vance will ask him how many 1s are there in the sequence. However, the sequence is too long for Shackler and he turns to you for help. Given you A, B and N, please help Shackler to solve the problem. Input The first line contains a single integer T (T <= 20), the number of test cases. Then there are T lines with each case in a line. For each case, there are three integers A, B, N. 1<=A<=10000, 1<=B<=10^16, 1<=N<=10^12. Output For each case, you should print one line begin with ˇ°Case #ˇ±(quotations for explanation only) followed by the case number and a colon. After a single space, you should output the answer. (See the sample output for more details) Sample Input
Sample Output
Author BJTU Source | ||||||||||
|