long long fastPower(long long base, long long power) {
long long result = 1;
while (power > 0) {
if (power & 1) {
result = result * base % 1000;
}
power >>= 1;
base = (base * base) % 1000;
}
return result;
}
06-04
672
03-15
564