2016 省赛热身 2016

2016

Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu

Description

In mathematics, a polygonal number is a number represented as dots or pebbles arranged in the shape of a regular polygon. The dots are thought of as alphas (units). These are one type of 2-dimensional figurate numbers. The following picture shows how triangular numbers, square numbers, pentagonal numbers and hexagonal numbers represented as dots arranged in the shape of corresponding regular polygon.

2016 is not only a leap year but also a triangular and hexagonal year. If you are patient enough, you can count the number of the dots in the left triangle or in the right hexagon in the following picture. The number of dots in each shape is 2016.

Therefore, 2016 is a triangular-hexagonal-leap year. The previous triangular-hexagonal-leap year is 1540 and the next is 2556. So living to see 2016 is very rare experience.

You task is to list the triangular-hexagonal-leap years from 2016 to 990528. 990528 is also a triangular-hexagonal-leap year.

Input

This problem has no input.

Output

Please print each triangular-hexagonal-leap year in increasing order.

For example, if you are asked to list the triangular-hexagonal-leap years from 780 to 2556, the output should be:

 780
1128
1540
2016
2556

Sample Output

2016
2556
...  <-- some lines are skipped
990528简单题意:  输出从2016 -- 990528符合条件的年份,这个年份的条件为:是闰年,是三边形, 是六边形,的点思路分析:  思路不难想,先判断闰年,在判断三边形,六边形。。。
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    double a,b;
    while(scanf("%lf%lf",&a,&b)!=EOF)
        printf("%f %f\n",2*a*b,(4*a*a*b*b)/(a*a+b*b));
    return 0;
}
				
时间: 2024-10-04 15:08:59

2016 省赛热身 2016的相关文章

2016 省赛热身 2016 Programming Ability Test

Programming Ability Test Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description Programming Ability Test (PAT) aims to evaluate objectively, through unified examinations with automatic online judging system, the abilit

2016湖南省赛----A 2016 (同余定理)

2016湖南省赛----A 2016 (同余定理) Description 给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数. Input 输入包含不超过 30 组数据. 每组数据包含两个整数 n,m (1≤n,m≤10 9). Output 对于每组数据,输出一个整数表示满足条件的数量. Sample Input 32 63 2016 2016 1000000000 1000000000 Sample

2016 省赛热身 Handshakes

Handshakes Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description Last week, n students participated in the annual programming contest of Marjar University. Students are labeled from 1 to n. They came to the competitio

2016 省赛热身 Ellipse

Ellipse Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description There is an beautiful ellipse whose curve equation is: . There is a parallelogram named P inscribed in this ellipse. At the same time, the parallelogram P 

2016 省赛热身 In the Rain

In the Rain Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Description Fujiwara no Mokou was formerly an ordinary human, but she became an immortal being after drinking the Hourai Elixir about 1300 years ago. She has some

(三角剖分)三角形和矩形的面积交 2016湖南省赛

1 // (三角剖分)三角形和矩形的面积交 2016湖南省赛 2 3 #include <iostream> 4 #include <cstdio> 5 #include <cstring> 6 #include <stack> 7 #include <queue> 8 #include <cmath> 9 #include <algorithm> 10 using namespace std; 11 12 const i

2016湖南省赛 I Tree Intersection(线段树合并,树链剖分)

2016湖南省赛 I Tree Intersection(线段树合并,树链剖分) 传送门:https://ac.nowcoder.com/acm/contest/1112/I 题意: 给你一个n个结点的树,树上每个节点有自己的颜色 问你删除第i条边后形成的两颗子树有多少个相同的颜色 题解: 树链剖分写法: 对于每一种颜色来说,如果这个颜色是在单独的一颗子树中,那么就不会对其他的边产生贡献,所以我们单独对每一种颜色对边的贡献讨论,如果这个颜色只有一个,那么就不会产生贡献,否则,他就可以在两个相同颜

第十二届湖南省赛 A - 2016 ( 数学,同余转换)

给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数. Input 输入包含不超过 30 组数据. 每组数据包含两个整数 n,m (1≤n,m≤10 9). Output对于每组数据,输出一个整数表示满足条件的数量.Sample Input 32 63 2016 2016 1000000000 1000000000 Sample Output 1 30576 7523146895502644 Hint 思路:

PhpStorm 2016.2,WebStorm 2016.2最新版本免费注册激活方法

最新PhpStorm 2016.2 .WebStorm 2016.2.PyCharm  2016.2激活方式 打开网址 http://idea.lanyus.com/ 选择获取注册码,复制生成的验证码 安装完成后,打开软件,依次选择菜单栏 Help -> Register-> Activation code ->输入复制验证码->确定完成.