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

134/359

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 smriad Cpp 0.11s
11 sakib_muhit Cpp 0.11s
12 haasib Cpp 0.11s
13 ash12 Cpp 0.12s
14 ammasum Cpp 0.12s
15 return_SS Cpp 0.12s
16 AlaminJust Cpp 0.12s
17 onucsecu Cpp 0.12s
18 kamran_ahmad Cpp 0.12s
19 deder Cpp 0.12s
20 joy25896 Cpp 0.13s
21 Nusaiba Cpp 0.13s
22 ovis96 Cpp 0.18s
23 Ishrak Cpp 0.19s
24 anik_JU Cpp 0.22s
25 mahrahat Cpp 0.23s
26 Pure_Protea Cpp 0.25s
27 maxhasan Cpp 0.25s
28 jayed_al_hasan Cpp 0.26s
29 emrul Cpp 0.27s
30 Dragon_162 Cpp 0.27s
31 mahbub07 Cpp 0.27s
32 md_borhan Cpp 0.32s
33 Robinsoncruso Cpp 0.32s
34 mhiceiuk Cpp 0.33s
35 moshiur_cse15 Cpp 0.34s
36 nasif2587 Cpp 0.38s
37 yasirnabil534 Cpp 0.40s
38 liar Cpp 0.41s
39 Zeronfinity Cpp 0.43s
40 swapnil Cpp 0.43s
41 anowar1112 Cpp 0.45s
42 ImagineWarrior Cpp 0.47s
43 prantacse14 Cpp 0.48s
44 ahqmrf Cpp 0.48s
45 drifter Cpp 0.49s
46 jayanto Cpp 0.49s
47 froghramar Cpp 0.50s
48 SKL12 Cpp 0.50s
49 ssavi Cpp 0.51s
50 Koushik_12 Cpp 0.51s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support