0) { // If y is odd, multiply x with result if ($y & 1) $res = ($res * $x) % $p; // y must be even now $y = $y >> 1; // y = y/2 $x = ($x * $x) % $p; } return $res; } $mod = pow(10, 9) + 7; fscanf(STDIN, "%d %d %d", $a, $b, $t); $k = intval(($a + $b) / 2); $answer = power($k, $t, $mod); $answer = $answer % $mod; echo $answer . PHP_EOL; ?>