main(){
int div = S를 K로 나눈 몫
int mod = S를 K로 나눈 나머지
곱의 최대값 = div (k-mod)개와 (div+1) mod개를 모두 곱한 값
}
import java.io.*;
class Main {
static int K;
static int S;
static long MaxScore = Long.MIN_VALUE;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
S = sc.nextInt();
K = sc.nextInt();
int div = S / K;
int mod = S % K;
long answer = (long) (Math.pow((long) div, (K - mod)) * Math.pow((long) (div + 1), (mod)));
System.out.println(answer);
}
}