Description

Gerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to . Then he measured the length of its sides, and found that each of them is equal to an integer number of centimeters. There the properties of the hexagon ended and Gerald decided to draw on it.

He painted a few lines, parallel to the sides of the hexagon. The lines split the hexagon into regular triangles with sides of 1 centimeter. Now Gerald wonders how many triangles he has got. But there were so many of them that Gerald lost the track of his counting. Help the boy count the triangles.

Input

The first and the single line of the input contains 6 space-separated integers a1, a2, a3, a4, a5 and a6 (1 ≤ ai ≤ 1000) — the lengths of the sides of the hexagons in centimeters in the clockwise order. It is guaranteed that the hexagon with the indicated properties and the exactly such sides exists.

Output

Print a single integer — the number of triangles with the sides of one 1 centimeter, into which the hexagon is split.

Sample Input

Input
1 1 1 1 1 1
Output
6
Input
1 2 1 2 1 2
Output
13

Hint

This is what Gerald's hexagon looks like in the first sample:

And that's what it looks like in the second sample:

题意:给出一个六边形,求它由多少个小三角形组成

首先要知道,一个大的等边三角形由它的边长乘以边长个小三角形组成,那么给六边形加上三个三角形就可以形成一个大的等边三角形,最后就好求了吧

#include"iostream"
#include"cstdio"
using namespace std;
int main()
{
int a1,a2,a3,a4,a5,a6;
cin>>a1>>a2>>a3>>a4>>a5>>a6;
int l=a1+a2+a3;
cout<<l*l-a1*a1-a3*a3-a5*a5<<endl;
return ;
}

集训第六周 O题的更多相关文章

  1. 集训第六周 M题

    Description   During the early stages of the Manhattan Project, the dangers of the new radioctive ma ...

  2. 集训第六周 E题

    E - 期望(经典问题) Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit S ...

  3. 程序设计入门—Java语言 第六周编程题 1 单词长度(4分)

    第六周编程题 依照学术诚信条款,我保证此作业是本人独立完成的. 1 单词长度(4分) 题目内容: 你的程序要读入一行文本,其中以空格分隔为若干个单词,以'.'结束.你要输出这行文本中每个单词的长度.这 ...

  4. hdu 4548 第六周H题(美素数)

    第六周H题 - 数论,晒素数 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   De ...

  5. 集训第六周 古典概型 期望 D题 Discovering Gold 期望

    Description You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell o ...

  6. 集训第六周 矩阵快速幂 K题

    Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. F ...

  7. 集训第六周 数学概念与方法 计数 排列 L题

    Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样. 话 ...

  8. 集训第六周 数学概念与方法 J题 数论,质因数分解

    Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all g ...

  9. 集训第六周 数学概念与方法 数论 线性方程 I题

    Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Tr ...

随机推荐

  1. python系列1_travel

    Python__copy copy模块用于对象的拷贝操作.该模块只提供了两个主要的方法:copy.copy与copy.deepcopy,分别表示浅复制与深复制. 浅拷贝(copy):拷贝父对象,不会拷 ...

  2. Android中集成第三方支付

    常见的第三方支付解决方案 支付宝支付 微信支付 银联支付 Ping++统一支付平台(需要继承服务器端和客户端) 短信支付 支付宝的集成流程 相关资料链接: 支付宝支付指引流程:支付指引流程 支付宝An ...

  3. Android的handler消息机制

    Hnadler机制中有这么几部分构成,包括 handler.Message.Looper和MessageQueue.要想在一个线程中使用Handler的话必须要有Looper和MessageQueue ...

  4. Neither BindingResult nor plain target object for bean name 'user' available as request attribute

    这个异常是因为jsp页面写错了. 把<form:form></form:form>标签改成普通的标签即可. 应该是第一次访问的时候,user是空的.但springmvc不能是空 ...

  5. Android使用Gson(相当于C#的Newtonsoft.Json)非常好用

    C#转Java有一段时间了,之前做ASP.NET WebAPI微软竟将第三方类库Newtonsoft.Json作为VS新建MVC和WebAPI项目默认必备的Json工具Nuget包,可想而知这个包有多 ...

  6. mac重启iterm后不会自动加载.bash_profile

    我用的zsh,由于平时设置的环境变量都是在.bash_profile文件中,每次重启iterm后,都需要重启手动加载.bash_profile文件,很麻烦. 设置自动加载.bash_profile的方 ...

  7. QT入门学习

    第一个QT程序 #include<QApplication> #include<QDialog> #include<QLabel> #include<QTex ...

  8. jquery 序列化form表单

    1.为什么要将form表单序列化? ajax上传form表单的原始方式,是将form表单中所需要的键值对先获取,然后再组装成数据(两种方式:http:localhost:8080/test.do?pe ...

  9. webpack3整理(第一节/满三节)

    一.css文件打包到js中(loader的三种写法) //第一种写法:直接用use. module: { rules: [{ test: /\.css$/, use: ['style-loader', ...

  10. org.springframework.orm.hibernate4.support.OpenSessionInterceptor

    /* * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Vers ...