CF309D.Tennis Rackets

省选/NOI-

通过率:0%

时间限制:3.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Professional sport is more than hard work. It also is the equipment, designed by top engineers. As an example, let's take tennis. Not only should you be in great shape, you also need an excellent racket! In this problem your task is to contribute to the development of tennis and to help to design a revolutionary new concept of a racket!

The concept is a triangular racket. Ant it should be not just any triangle, but a regular one. As soon as you've chosen the shape, you need to stretch the net. By the time you came the rocket had n holes drilled on each of its sides. The holes divide each side into equal n + 1 parts. At that, the m closest to each apex holes on each side are made for better ventilation only and you cannot stretch the net through them. The next revolutionary idea as to stretch the net as obtuse triangles through the holes, so that for each triangle all apexes lay on different sides. Moreover, you need the net to be stretched along every possible obtuse triangle. That's where we need your help — help us to count the number of triangles the net is going to consist of.

Two triangles are considered to be different if their pictures on the fixed at some position racket are different.

职业体育不仅仅需要刻苦训练,还需要由顶尖工程师设计的装备。以网球为例:你不仅需要保持极佳的身体状态,还需要一把出色的球拍!在本题中,你的任务是为网球运动的发展贡献力量,协助设计一款革命性的新型球拍!

该设计理念是一款三角形球拍。而且它不应是任意三角形,而必须是一个正三角形。一旦确定了形状,就需要绷上网线。当你到来时,球拍的每条边上已经钻有 nn 个孔。这些孔将每条边等分为 n+1n+1 段。此外,每条边上距离每个顶点最近的 mm 个孔仅用于改善通风,不能用于穿网线。下一个革命性构想是:通过这些孔绷出钝角三角形的网眼,使得每个三角形的三个顶点分别位于三条不同的边上。并且,你需要绷出所有可能的钝角三角形网眼。此时,我们就需要你的帮助——请帮我们计算出网眼总共包含多少个三角形。

若两个三角形在固定位置的球拍上所呈现的图形不同,则认为它们是不同的三角形。

输入格式

The first and the only input line contains two integers n, m .

第一行且唯一的一行输入包含两个整数 nn、mm 。

输出格式

Print a single number — the answer to the problem.

输出一个数字——该问题的答案。

输入输出样例

  • 输入#1

    3 0

    输出#1

    9
  • 输入#2

    4 0

    输出#2

    24
  • 输入#3

    10 1

    输出#3

    210
  • 输入#4

    8 4

    输出#4

    0

说明/提示

For the following picture n = 8, m = 2. White circles are the holes for ventilation, red circles — holes for net stretching. One of the possible obtuse triangles is painted red.

对于下图,n=8n = 8,m=2m = 2。白色圆圈为通风孔,红色圆圈为固定网的孔。其中一个可能的钝角三角形被涂成红色。

输入解题思路,AI测评打分。不知道怎么写?

首页