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

# 174/460

Solve/Submission

### Ranking

# User Language Timing
01 Morass Cpp14 0.01s
02 RandyWaterhouse Python3 0.06s
03 duronto20 Cpp14 0.06s
04 tariqiitju Cpp14 0.06s
05 feodorv Cpp14 0.06s
06 rayhan50001 Cpp14 0.07s
08 mamunparvez Cpp14 0.08s
09 BishalG Cpp 0.09s
10 jalal Cpp 0.09s
11 seyedssz Cpp14 0.09s
12 rana_cse Cpp14 0.10s
13 FariD Cpp 0.10s
14 sakib_muhit Cpp14 0.11s
15 sazal_dev Cpp14 0.11s
16 subhashis_cse Cpp 0.11s
17 haasib Cpp14 0.11s
20 joymollick Cpp14 0.11s
21 nothing10 Cpp 0.12s
22 tanvir_ju C 0.12s
24 ammasum Cpp14 0.12s
25 rithu Cpp14 0.12s
26 return_SS Cpp14 0.12s
27 ash12 Cpp14 0.12s
28 siamcr7 Cpp 0.12s
29 deder Cpp14 0.12s
30 AlaminJust Cpp14 0.12s
31 onucsecu Cpp14 0.12s
32 rashedul007 C 0.12s
33 joy25896 Cpp14 0.13s
34 astrolion7 Python3 0.13s
35 Nusaiba Cpp14 0.13s
36 pulak_ict_mbstu Cpp 0.14s
37 ovis96 Cpp14 0.18s
38 Ishrak Cpp14 0.19s
39 anik_JU Cpp14 0.22s
40 MAHRahat Cpp14 0.23s
41 Pure_Protea Cpp14 0.25s
42 maxhasan Cpp14 0.25s
43 njrafi Cpp14 0.26s
44 jayed_al_hasan Cpp14 0.26s
45 Dragon_162 Cpp14 0.27s
46 rajdipsaha Cpp 0.27s
47 emrul Cpp14 0.27s
48 mahbub07 Cpp14 0.27s
49 Rajan_sust Cpp14 0.31s
50 md_borhan Cpp14 0.32s
Feedback