31 lines
454 B
Markdown
31 lines
454 B
Markdown
# 平面分割
|
||
|
||
## Tags
|
||
|
||
- C++一本通
|
||
- 递推
|
||
|
||
## Description
|
||
|
||
同一平面内有$n$($n\le 500$)条直线,已知其中$p$($p\le 2$)条直线相交于同一点,则这$n$条直线最多能将平面分割成多少个不同的区域?
|
||
|
||
输入两个整数$n$($n\le 500$)和$p$($2\le p\le n$)
|
||
|
||
输出一个正整数,代表最多分割成的区域数目
|
||
|
||
## Example Cases
|
||
|
||
### Case 1
|
||
|
||
#### Input
|
||
|
||
```
|
||
12 5
|
||
```
|
||
|
||
#### Output
|
||
|
||
```
|
||
73
|
||
```
|