A8316 | Birthday
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Anna's got a birthday today. She invited many guests and cooked a huge (nearly infinite) birthday cake decorated by $n$ banana circles of different sizes. Maria's birthday is about to start in 7 minutes too, and while Anna is older, she decided to play the boss a little. She told Maria to cut the cake by $k$ straight-line cuts (the cutting lines can intersect) to divide banana circles into banana pieces.
Anna has many guests and she wants everyone to get at least one banana piece. That's why she told Maria to make the total number of banana pieces maximum. It's not a problem if some banana pieces end up on the same cake piece — the key is to make the maximum number of banana pieces. Determine what result Maria will achieve.
Anna has many guests and she wants everyone to get at least one banana piece. That's why she told Maria to make the total number of banana pieces maximum. It's not a problem if some banana pieces end up on the same cake piece — the key is to make the maximum number of banana pieces. Determine what result Maria will achieve.
输入格式
The first line contains two integers $n$ and $k$ — the number of banana circles and the number of cuts Maria should perform ( $1<=n<=1000$ , $1<=k<=10^{5}$ ). Next $n$ lines contain the positions and sizes of the banana circles (all banana circles are round). On the cake the Cartesian coordinate system is defined. Each line contains three integers $x$ , $y$ and $r$ — the coordinates of the center of the corresponding banana piece and its radius ( $-1000<=x,y<=1000$ , $1<=r<=1000$ ).
It is guaranteed that the banana circles do not intersect, do not touch each other and do not overlap with each other.
Pretest 10 is big test with $n=k=1000$ .
It is guaranteed that the banana circles do not intersect, do not touch each other and do not overlap with each other.
Pretest 10 is big test with $n=k=1000$ .
输出格式
Print the only integer — the largest number of banana pieces that Maria can get after she performs the $k$ straight-line cuts.
Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.
Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.
输入输出样例
输入 #1
1 1 0 0 1
输出 #1
2
输入 #2
3 1 0 0 1 3 0 1 6 0 1
输出 #2
6
输入 #3
1 3 0 0 1
输出 #3
7
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted