Let's consider some math problems.

JSZKC has a set A=A={1,2,...,N}. He defines a subset of A as 'Meo set' if there doesn't exist two integers in this subset with difference one. For example, When A={1,2,3},{1},{2},{3},{1,3} are 'Meo set'.

For each 'Meo set', we can calculate the product of all the integers in it. And then we square this product. At last, we can sum up all the square result of the 'Meo set'.

So please output the final result.

Input Format

The input file contains several test cases, each of them as described below.

  • The first line of the input contains one integers N(1≤N≤100), giving the size of the set.

There are no more than 100test cases.

Output Format

One line per case, an integer indicates the answer.

样例输入

3

样例输出

23

题目来源

The 2018 ACM-ICPC China JiangSu Provincial Programming Contest

 //要用java大数,规律为(n+1)!-1
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class a{
public static void main(String args[]){
Scanner cin=new Scanner (System.in);
int n;
BigInteger a=BigInteger.valueOf();
while(cin.hasNext()){
n=cin.nextInt();
BigInteger ans=BigInteger.valueOf();
for(int i=;i<=n+;i++)
{
ans=ans.multiply(BigInteger.valueOf(i));
//System.out.println(ans);
}
ans=ans.subtract(a);
System.out.println(ans);
}
}
}

最新文章

  1. HDU4329
  2. ERROR 1130 (HY000) Host ‘hostname’ is not allowed to connect to this MySQL server
  3. 基于Maven构建整合SpringMVC+Mybtis+Druid
  4. CentOS 6下安装nginx
  5. Android Fragment 真正的完全解析(上) (转载)
  6. python xlrd,xlwt 读写excel文件
  7. Visual Studio 2010打开水晶报表是出现二进制
  8. CSS背景属性
  9. c/c++ double的数字 转成字符串后 可以有效的避免精度要求不高的数
  10. Python 第一章 基础知识
  11. Android GridView增加HeaderView和FooterView的实现
  12. 用Arduino做一个可视化网络威胁级别指示器!
  13. 【.net 深呼吸】自定义应用程序配置节
  14. Asp.Net Core 2.0 项目实战(9) 日志记录,基于Nlog或Microsoft.Extensions.Logging的实现及调用实例
  15. docker环境中安装node、pm2,映射项目文件守护程序
  16. 软件开发者路线图梗概&amp;书摘chapter4
  17. 单行显示三级分销记录(同表自join)
  18. mac 终端光标在单词之间移动
  19. day27-反射
  20. “2017面向对象程序设计(Java)第十一周学习总结”存在问题的反馈及教学安排

热门文章

  1. Auto yes to the License Agreement on sudo apt-get -y install oracle-java7-installer
  2. PIX 防火墙
  3. C. An impassioned circulation of affection DP
  4. [PHP] – 性能优化 – Fcgi进程及PHP解析优化
  5. P4876 近似排列计数50
  6. readonly与const的区别
  7. 13.JAVA-包package、import使用
  8. JSON(未完待续,等讲到对象时再加)
  9. dubbo rest返回值异常Incompatible types: declared root type
  10. 获取元素Bytagname区别/for循环应用