题库练习 Polygons
← 上一题 下一题 →

A12797 | Polygons

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

You are given two integers $n$ and $k$ .

You need to construct $k$ regular polygons having same [circumcircle](https://en.wikipedia.org/wiki/Circumscribed_circle), with distinct number of sides $l$ between $3$ and $n$ .

![](/uploads/acgo/image/f26251a2aadb2793_983b081002cb.jpeg)Illustration for the first example.You can rotate them to minimize the total number of distinct points on the circle. Find the minimum number of such points.

输入格式

The only line of input contains two integers $n$ and $k$ ( $3 \le n \le 10^{6}$ , $1 \le k \le n-2$ ), the maximum number of sides of a polygon and the number of polygons to construct, respectively.

输出格式

Print a single integer — the minimum number of points required for $k$ polygons.

输入输出样例

输入 #1
6 2
输出 #1
6
输入 #2
200 50
输出 #2
708
C++ 编辑器
输入
输出