import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); BigInteger sum=BigInteger.ONE; BigInteger ten=new BigInteger("10"); for (int i = 2; i <=n; i++) { sum=sum.multiply(new BigInteger(i+"")); while(sum.remainder(ten).compareTo(BigInteger.ZERO)==0) sum=sum.divide(ten); } String s=sum.toString(); int len=s.length(); String str=""; if(len<k){ str=s; } else{ str+=s.substring(s.length()-k,s.length()); } System.out.println(str); sc.close(); } }
0.0分
0 人评分