n >= 6 的时候减3, 最后分类讨论, 上个Java import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); BigInteger ans = BigInteger.valueOf(); ) { ans = ans…