我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Count the Regions

What's the maximum number of regions definable by N zig-zag lines, each of which consists of two parallel infinite half-lines joined by a straight line segment?

Here is an example of 2 zig-zag lines yield 12 regions at the most.

Input

The input consists of a sequence of N (<= 10000), which is the number of the zig-zag lines, one per line.

Output

For each N, you should output the number of the maximum regions.

Sample Input

1
2

Sample Output

2
12

http://blog.csdn.net/xiao__dai/article/details/4441443

近期文章

  • VirtualBox:不能创建仅主机(Host-Only)网络连接.
  • Run Away
  • Secret Code
  • 最多有2000个点同时与服务器互传数据。用PHPredis队列socket,请大神写个示例代码
  • hibernate中session的update执行原理是怎样的
  • C# 如何将实体插入oracle数据库
  • hibernate 数据查询,查不出来
  • The Proper Key
  • 急问!! eclipse运行时 出现登陆界面 login 就变成下面图片这样
  • Android在activity中获取另一个布局中的button按钮
  • EXT.NET 布局有问题 MVC
  • 请问如何用shellexecute打开屏幕键盘osk.exe?
  • vba程序问题运行时提示溢出,我需要怎么修改才能运行
  • 创建mfc的向导对话框怎么做的呀
  • 新人,想问个mysql中的一个查询,有疑问
  • java接口与多线程的问题
  • myeclipse for spring 8.6 配置Tomcat7失败
  • android 开发如何获取网站图片
  • AutoFish
  • Catenyms

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华