While playing with geometric figures Alex has accidentally invented a concept of a nn-th order rhombus in a cell grid.

A 11-st order rhombus is just a square 1×11×1 (i.e just a cell).

A nn-th order rhombus for all n≥2n≥2 one obtains from a n−1n−1-th order rhombus adding all cells which have a common side with it to it (look at the picture to understand it better).


Alex asks you to compute the number of cells in a nn-th order rhombus.

Input
The first and only input line contains integer nn (1≤n≤1001≤n≤100) — order of a rhombus whose numbers of cells should be computed.

Output
Print exactly one integer — the number of cells in a nn-th order rhombus.

Examples
Input
1
Output
1
Input
2
Output
5
Input
3
Output
13
Note
Images of rhombus corresponding to the examples are given in the statement.

#include<iostream>
using namespace std;
int main(){int n;cin>>n;int sum=1;for(int i=2;i<=n;i++){sum+=4*(i-1);}cout<<sum<<endl;
}

ZCMU暑期训练四-G - Alex and a Rhombus相关推荐

  1. HRBU 2021年暑期训练阶段二Day3

    目录 A - Shuffle'm Up 题目链接: 题意: 做法: B - Prime Path 题目链接: 题意: 做法: C - Function Run Fun 题目链接: 题意: 做法: D ...

  2. Potato的暑期训练day#1题解 ——毒瘤构造

    Potato的暑期训练day#1 --毒瘤构造 题目链接: A.https://vjudge.net/problem/HDU-1214 B.https://vjudge.net/problem/Cod ...

  3. HRBU 2021年暑期训练阶段三Day1

    目录 A - Similar Strings 题目链接: 题意: 做法: B - card card card 题目链接: 题意: 做法: C - String 题目链接: 题意: 做法: D - C ...

  4. 暑期训练日志----2018.8.26

    训练第28天. 暑期训练最后一天,结束了... 看了看昨天下午网络赛的题,感觉自己也就能出一个...还是学的太少,新学期开始要加油,每天至少2个小时搞ACM 这个暑假收获很多,跟队友的配合比之前更有默 ...

  5. 暑期训练日志----2018.8.3

    训练第五天. 效率比昨天快了不少,但还是所有人中进度最慢的. 成功将排列与组合.以及延迟认可算法搞清楚了,而且之前欠的卡特兰数列和第一类.第二类斯特林数也补上了,组合数学的内容之差母函数.莫比乌斯反演 ...

  6. 现在各行各业的人们越来越多地依靠计算机来解决各种难题.翻译英语,公共英语PETS三级阅读与翻译试题训练 四...

    三级英语汉译英 1.他这次考试失败使他意识到定期复习功课是多么重要. He failed in the exam, which has made him aware of the importance ...

  7. Noip2019暑期训练2 反思

    经过两次测试,通过深刻的反思,我主要发现了以下易犯错误: 1.做题目时过于追求速度,导致好几处代码都出现手误打错的现象!而且,千万不要图快.图方便就复制粘贴,非常容易出错!(例如T3-party中直接 ...

  8. 牛客2021暑期训练1-A-Alice and Bob

    牛客2021暑期训练1-A-Alice and Bob 题目链接 题意 给定两堆石子n,m(1<=n,m<=5e3),Alice先手,对任意一堆取k(k>0)个,另一堆取s*k(s& ...

  9. 2021年暑期训练阶段四Day1

    目录 A - Hamburgers B - River Hopscotch C - Cup D - Fibonacci E - Dating with girls(1) F - Median G - ...

最新文章

  1. 献给那些怀揣IT梦想的北漂一族
  2. mysql无法本地连接,本地连接腾讯云Mysql失败问题
  3. java 与 xml_xml与java对象转换
  4. 还在用 Python 2.x?Python 3.7.0 正式发布!
  5. Recoil 是 React 的状态管理库
  6. Bug--Mybatis报错:There is no getter for property named 'id' in 'class java.lang.Integer'
  7. HDU - 3506 Monkey Party
  8. xcode6 怎样下载ios7模拟器
  9. Mac上安装最流畅的Windows XP Lite(免费虚拟机VirtualBox)
  10. python normalize函数_Python normalize包_程序模块 - PyPI - Python中文网
  11. position: relative相对定位
  12. 在线 excel 产品技术调研
  13. ensp配置服务器发布(将DMZ区的web服务区发布,供client访问)
  14. android精选源码,erp交互效果摩天轮高仿斗鱼直播View炫酷进度条源码
  15. qrcode生成二维码
  16. JavaWEB十五:QQzone项目的整体分析及web关键点总结
  17. 6 实现多主机间 Docker 容器通信
  18. js选出给定数组中所有的偶数/奇数/n的倍数(filter)
  19. 分布式调度框架Tbschedule运行流程【03】
  20. 学会python如何利用业余时间赚外快?分享几个接私单途径,分分钟月入3K+

热门文章

  1. semantic ui中文文档_求你别再用swagger了,给你推荐几个在线文档生成神器
  2. Redmi 智能电视 X 2022 评测
  3. 阿里真的开始衰落了吗?
  4. Nodelist转化问题。
  5. 【Codeforces】WHU校赛2019 Store(线段树+二分)
  6. Windows Server 2012 R2 系统配置指南_戴有炜编著
  7. 国产手机均价下跌,苹果逆势增长,iPhone仍是消费者最爱
  8. 9 张手绘图:阐明机器学习模型训练全流程
  9. seacms_locoy.php,seacms_v6.6
  10. Microsoft Orleans 之 入门指南