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 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

310/725

Solve/Submission

Ranking

# User Language Timing
01 Morass Cpp14 0.01s
02 njrafi Cpp14 0.01s
03 Rajan_sust Cpp14 0.01s
04 tariqiitju Cpp 0.01s
05 yasirnabil534 Cpp 0.01s
06 kissu_pari_na Cpp14 0.01s
07 ssavi Cpp 0.01s
08 tanu_1603070 Cpp 0.05s
09 RandyWaterhouse Python3 0.06s
10 feodorv Cpp14 0.06s
11 duronto20 Cpp14 0.06s
12 rayhan50001 Cpp14 0.07s
13 murad_al_wajed Cpp14 0.07s
14 1604099_ishtiaq Cpp 0.07s
15 mamunparvez Cpp14 0.08s
16 seyedssz Cpp14 0.09s
17 Ayon_neub Python3 0.09s
18 BishalG Cpp 0.09s
19 jalal Cpp 0.09s
20 nathantheinventor Python3 0.09s
21 FariD Cpp 0.10s
22 milon019 Cpp 0.10s
23 rana_cse Cpp14 0.10s
24 Starscream Cpp 0.10s
25 sadia2427 Cpp14 0.11s
26 sazal_dev Cpp14 0.11s
27 smriad Cpp14 0.11s
28 haasib Cpp14 0.11s
29 sakib_muhit Cpp14 0.11s
30 MRoy C 0.11s
31 Azaxdev Cpp 0.11s
32 shefin Cpp 0.11s
33 subhashis_cse Cpp 0.11s
34 joymollick Cpp14 0.11s
35 Mahadi_Hasan Cpp 0.11s
36 abdulmukit Cpp 0.11s
37 prodipdatta7 Cpp 0.11s
38 Jisancse Cpp 0.12s
39 Maliha_Chowdhury Cpp 0.12s
40 MoYan Cpp 0.12s
41 Rambo Cpp14 0.12s
42 Robbinb1993 Cpp 0.12s
43 Madhab Cpp 0.12s
44 nothing10 Cpp 0.12s
45 AlaminJust Cpp14 0.12s
46 rithu Cpp14 0.12s
47 siamcr7 Cpp 0.12s
48 rashedul007 C 0.12s
49 int_elligent C 0.12s
50 unknown420 Cpp 0.12s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support