DCP-23: Another Bigmod Problem Back to All Problems

Hard Math > Modular Arithmetic


Given A, B and C, find the value of (A^B)%C. Input: ------ First line will contain a single integer T (T<1000) indicating number of test case. After that, T lines will follow with three positive integers A, B and C. (A,B,C<=10^18) Output: ------- For each test case, print a single line containing the case number and the value of (A^B)%C. See the sample case. Sample Input ------------ 3 12 43 123 1231 123 1000 12345 123456789 123456789012345 Sample Output ------------- Case 1: 6 Case 2: 991 Case 3: 59212459031520


Problem Setter:

Mohammad Samiul Islam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 2.00
C# 2.00
PHP 2.00

Problem Stats

126/345

Solve/Submission

Ranking

# User Language Timing
01 duronto20 Cpp 0.06s
02 tariqiitju Cpp 0.06s
03 rayhan50001 Cpp 0.07s
04 murad_al_wajed Cpp 0.07s
05 mamunparvez Cpp 0.08s
06 seyedssz Cpp 0.09s
07 rana_cse Cpp 0.10s
08 sadia2427 Cpp 0.11s
09 sazal_dev Cpp 0.11s
10 sakib_muhit Cpp 0.11s
11 haasib Cpp 0.11s
12 ash12 Cpp 0.12s
13 deder Cpp 0.12s
14 return_SS Cpp 0.12s
15 onucsecu Cpp 0.12s
16 joy25896 Cpp 0.13s
17 Nusaiba Cpp 0.13s
18 ovis96 Cpp 0.18s
19 Ishrak Cpp 0.19s
20 anik_JU Cpp 0.22s
21 mahrahat Cpp 0.23s
22 Pure_Protea Cpp 0.25s
23 maxhasan Cpp 0.25s
24 jayed_al_hasan Cpp 0.26s
25 emrul Cpp 0.27s
26 SakibAlamin Cpp 0.28s
27 md_borhan Cpp 0.32s
28 Robinsoncruso Cpp 0.32s
29 mhiceiuk Cpp 0.33s
30 moshiur_cse15 Cpp 0.34s
31 nasif2587 Cpp 0.38s
32 yasirnabil534 Cpp 0.40s
33 liar Cpp 0.41s
34 Zeronfinity Cpp 0.43s
35 swapnil Cpp 0.43s
36 anowar1112 Cpp 0.45s
37 ImagineWarrior Cpp 0.47s
38 prantacse14 Cpp 0.48s
39 ahqmrf Cpp 0.48s
40 drifter Cpp 0.49s
41 jayanto Cpp 0.49s
42 froghramar Cpp 0.50s
43 SKL12 Cpp 0.50s
44 ssavi Cpp 0.51s
45 Koushik_12 Cpp 0.51s
46 as_couple Cpp 0.52s
47 nazmulasha Cpp 0.54s
48 rashed_cse Cpp 0.58s
49 Masum_ice Cpp 0.60s
50 Unseen Cpp 0.62s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support