DCP-441: Page Number Back to All Problems

Easy Math > Basic Math


The oldest man on earth Mr. Royal is a retired spy agent of BCI(Bangladesh Counter Intelligence). Since a retired man, he spent his leisure time by reading spy thriller books. When he reads book, he maintain a sequence of pages. If he reads **N** pages in one day, then next day he will read twice pages **(2*N)** of previous days. For example, if he reads **10** pages in **1st** day, then he reads **20** pages on **2nd** day, **40** pages on **3rd** day, **80** pages on **4th** day and so on. ![enter image description here][1] One day his great grandchildren asked him, which day did he read the **Kth** page of the book. Since Mr. Royal is a old man he is not able to keep track of pages and days. You have to help him to solve this. You are given the number of pages (**N**) he read on the first day, you have to find the day when he read the **Kth** page of the book. Input: ------ Input start with test cases **T**. Each test case there is two integer **N** and **K**, the number of pages read on the first day and the page number of the book. Constraints: ----- 1<=T<=100000 1<=N,K<=10^18 Output: ------- Print a line **'Case X: Y'** without quote mark. **X** is the case number start with **1** and **Y** is the answer. Sample Input ------------ 2 1 5 3 2 Sample Output ------------- Case 1: 3 Case 2: 1 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/7920b186-9731-c580-a694-08d521d5ee48_a0e87c8d1b5f423196934a6abc23840a_W197xH256.png


Problem Setter:

Monikrishna Roy

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

139/453

Solve/Submission

Ranking

# User Language Timing
01 astinaam Cpp14 0.04s
02 FariD Cpp14 0.04s
03 Morass Cpp14 0.04s
04 neilanjona_mu C 0.05s
05 int_elligent Cpp 0.05s
06 Dalu Cpp 0.05s
07 Fahim_41 C 0.05s
08 Ramprosad Cpp 0.05s
09 SakibAlamin Cpp14 0.05s
10 nasib_mbstu Cpp 0.05s
11 MRITuhin Cpp 0.05s
12 The_Viper Cpp 0.05s
13 pulak_ict_mbstu Cpp 0.05s
14 Shakil_Mahmud Cpp 0.05s
15 haasib Cpp 0.05s
16 Nazmul_WUB Cpp 0.05s
17 lazyfahim Cpp14 0.05s
18 Ishrak Cpp 0.06s
19 Nur_Alam39 Cpp 0.06s
20 mbstu_nitai Cpp 0.06s
21 Tanmoy Cpp 0.06s
22 rohijulislam Cpp 0.06s
23 Pure_Protea Cpp14 0.06s
24 showmic Cpp 0.06s
25 Durbin Cpp14 0.06s
26 cse_nazmul Cpp 0.06s
27 MRoy Cpp 0.06s
28 ssavi Cpp 0.06s
29 saifkhan007420 Cpp 0.06s
30 rayhan50001 Cpp 0.06s
31 shishir09 Cpp 0.06s
32 Dragon_Curve Cpp 0.06s
33 prodipdatta7 Cpp 0.06s
34 arafat_hasan Cpp14 0.06s
35 SaikatS Cpp 0.06s
36 Sarwar05 Cpp 0.06s
37 kissu_pari_na Cpp14 0.06s
38 Sakhawat_CoU Cpp14 0.06s
39 feodorv C 0.06s
40 miltonbhowmick Cpp14 0.06s
41 susmoys Cpp 0.06s
42 Not_Found0001 Cpp 0.06s
43 porag_ict Cpp14 0.06s
44 Shahriar_88 Cpp 0.06s
45 Zihad C 0.06s
46 desh_chowdhury Cpp 0.06s
47 arafat666 C 0.06s
48 shuvo_mbstu Cpp 0.06s
49 bug_is_everywhere Cpp 0.07s
50 sifat_15 Cpp 0.07s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support