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

275/667

Solve/Submission

Ranking

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

Your feedback is our precious!



Or call +88 02 9853138 for support