杭电5621 KK's Point

KK's Point

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 938    Accepted Submission(s): 307


Problem Description
Our lovely KK has a difficult mathematical problem:He points  N(2N105)  points on a circle,there are all different.Now he's going to connect the  N  points with each other(There are no three lines in the circle to hand over a point.).KK wants to know how many points are there in the picture(Including the dots of boundary).
 

Input
The first line of the input file contains an integer  T(1T10) , which indicates the number of test cases.

For each test case, there are one lines,includes a integer  N(2N105) ,indicating the number of dots of the polygon.
 

Output
For each test case, there are one lines,includes a integer,indicating the number of the dots.
 

Sample Input
  
2 3 4
 

Sample Output
  
3 5
 

Source
 

Recommend
hujie   |   We have carefully selected several similar problems for you:   5634  5633  5632  5631  5630 
 
每四个会出现一个交点,本题数据较大long long 过不去,需要加unsigned:
#include<stdio.h>
unsigned long long int i,j,k,l,m,n,p,ans;
int main()
{
	scanf("%I64u",&p);
	while(p--)
	{
		scanf("%I64u",&n);
		k=n; 
		if(n>=4)
		k=k+n*(n-1)/2*(n-2)/3*(n-3)/4;
		printf("%I64u\n",k);
	}
}


### 使用 KubeKey 安装 Kubernetes 和 KubeSphere #### 准备工作 为了使用 KubeKey 进行离线部署,用户需准备清单 `manifest` 文件来描述目标集群环境所需配置。此文件涵盖了网络设置、节点角色分配以及其他必要的参数设定[^1]。 ```yaml apiVersion: kubekey.kubesphere.io/v1alpha2 kind: Cluster metadata: name: sample spec: hosts: - {name: node1, address: 192.168.0.2, internalAddress: 192.168.0.2, user: root, password: Password@123} - {name: node2, address: 192.168.0.3, internalAddress: 192.168.0.3, user: root, password: Password@123} - {name: node3, address: 192.168.0.4, internalAddress: 192.168.0.4, user: root, password: Password@123} roleGroups: etcd: - node1 - node2 - node3 master: - node1 - node2 - node3 worker: - node1 - node2 - node3 kubernetes: version: v1.26.5 imageRepo: registry.cn-beijing.aliyuncs.com/kubesphereio network: plugin: calico kubePodsCIDR: 10.233.64.0/18 kubeServiceCIDR: 10.233.0.0/18 ``` 上述 YAML 片段展示了如何指定主机列表及其对应的 IP 地址、用户名和密码;定义各节点的角色分组(如控制平面成员或计算节点),并指明所期望安装的 Kubernetes 版本和其他重要属性。 #### 导出制品 Artifact 文件 一旦完成了 `manifest` 文件编写,则可通过执行如下命令导出所需的全部资源包: ```bash kk create cluster --with-kubesphere v3.3.0 -f config-sample.yaml ``` 这条指令会基于给定的配置自动生成适用于当前场景下的所有必要组件,并将其打包成一个易于传输的形式——即所谓的 "artifact"[^1]。 #### 执行离线安装过程 当拥有了一份完整的 artifact 后,在目标机器上仅需运行下面这串脚本来启动整个安装流程: ```bash ./kk create cluster -f ./config-sample.yaml --offline=true --artifact=./artifacts.tar.gz ``` 这段 Shell 命令告知 KubeKey 应采用何种方式读取先前创建好的 artifact 并据此构建起功能完备的 Kubernetes 及附加服务实例集合。 #### 验证安装成果 最后一步是要确认新搭建起来的服务是否正常运作。可以通过访问默认提供的 Web 控制台地址 http://<任一master节点IP>:30880 或者利用 CLI 工具来进行验证操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值