so I have an assignment to make a power program. but because of its big number, its must be modulo by 10^9 + 7. The program was executed too long. What should I do to reduce executing the program?
Sorry for my bad english.
#include <stdio.h>
int main () {
int t;
int i;
long long int temp;
scanf("%d", &t);
for (i = 1; i <= t; i++) {
long long int a, n;
scanf("%lld %lld", &a, &n);
long long int total = 1;
long long int mod = 1000000007;
for (temp = 1; temp <= n; temp++) {
total = ((total % mod) * (a % mod)) % mod;
}
printf("Case #%d: %lld\n", i, total);
}
}