Language: Java

import java.util.*;
public class Main {
  	private static final int MAX = 510000;
	private static long[] fac = new long[MAX];
	private static long[] inv = new long[MAX];
	private static long[] finv = new long[MAX];
  
  	public Main() {
    	fac[0] = fac[1] = 1;
		finv[0] = finv[1] = 1;
		inv[1] = 1;
		for(int i = 2; i < MAX; i++) {
			fac[i] = fac[i - 1] * i % constant;
			inv[i] = constant - inv[constant%i] * (constant / i) % constant;
			finv[i] = finv[i - 1] * inv[i] % constant;
		}
    }
  
    public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt();
		int M = s.nextInt();
		int K = s.nextInt();

		final LongBinaryOperator pow = (i, j) -> {
			long result = 1;
			while(j > 0) {
				if((j & 1) == 1)
					result = (result * i) % constant;
				i = (i  * i) % constant;
				j >>= 1;
			}
			return result;
		};

		final IntUnaryOperator function = i -> {
			return (int)(M * getNewCom(N - 1, i) % constant * pow.applyAsLong(M-1, N-i-1) % constant);
		};
		
		long result = 0;
		for(int i = 0; i < K + 1; i++) {
			result = (result + function.applyAsInt(i)) % constant;
		}

		System.out.println(result);
    }
  
  	private static long getNewCom(int n, int k) {
		if( n < k) return 0;
		if (n < 0 || k < 0) return 0;
		return fac[n] * (finv[k] * finv[n - k] % constant) % constant;
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
			fac[i] = fac[i - 1] * i % constant;
			                          ^
  symbol:   variable constant
  location: class Main
Main.java:14: error: cannot find symbol
			inv[i] = constant - inv[constant%i] * (constant / i) % constant;
			         ^
  symbol:   variable constant
  location: class Main
Main.java:14: error: cannot find symbol
			inv[i] = constant - inv[constant%i] * (constant / i) % constant;
			                        ^
  symbol:   variable constant
  location: class Main
Main.java:14: error: cannot find symbol
			inv[i] = constant - inv[constant%i] * (constant / i) % constant;
			                                       ^
  symbol:   variable constant
  location: class Main
Main.java:14: error: cannot find symbol
			inv[i] = constant - inv[constant%i] * (constant / i) % constant;
			                                                       ^
  symbol:   variable constant
  location: class Main
Main.java:15: error: cannot find symbol
			finv[i] = finv[i - 1] * inv[i] % constant;
			                                 ^
  symbol:   variable constant
  location: class Main
Main.java:25: error: cannot find symbol
		final LongBinaryOperator pow = (i, j) -> {
		      ^
  symbol:   class LongBinaryOperator
  location: class Main
Main.java:29: error: cannot find symbol
					result = (result * i) % constant;
					                        ^
  symbol:   variable constant
  location: class Main
Main.java:30: error: cannot find symbol
				i = (i  * i) % constant;
				               ^
  symbol:   variable constant
  location: class Main
Main.java:36: error: cannot find symbol
		final IntUnaryOperator function = i -> {
		      ^
  symbol:   class IntUnaryOperator
  location: class Main
Main.java:37: error: cannot find symbol
			return (int)(M * getNewCom(N - 1, i) % constant * pow.applyAsLong(M-1, N-i-1) % constant);
			                                       ^
  symbol:   variable constant
  location: class Main
Main.java:37: error: cannot find symbol
			return (int)(M * getNewCom(N - 1, i) % constant * pow.applyAsLong(M-1, N-i-1) % constant);
			                                                                                ^
  symbol:   variable constant
  location: class Main
Main.java:42: error: cannot find symbol
			result = (result + function.applyAsInt(i)) % constant;
			                                             ^
  symbol:   variable constant
  location: class Main
Main.java:51: error: cannot find symbol
		return fac[n] * (finv[k] * finv[n - k] % constant) % constant;
		                                         ^
  symbol:   variable constant
  location: class Main
Main.java:51: error: cannot find symbol
		return fac[n] * (finv[k] * finv[n - k] % constant) % constant;
		                                                     ^
  symbol:   variable constant
  location: class Main
15 errors